From d7c8f1f58d10a8ad98856d619ee796623ae8cc56 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Feb 2022 19:15:01 +0000 Subject: [PATCH] CodeGen from PR 16108 in Azure/azure-rest-api-specs Merge 48158491575e1214f7f915326da78117a76e95d9 into 3f78f3bc2d2546511853ad1931360ccdd34b0175 --- .../CHANGELOG.md | 3 +- .../README.md | 7 +- .../SAMPLE.md | 1400 +++++++++++++++ .../pom.xml | 98 +- .../healthcareapis/HealthcareApisManager.java | 177 +- .../fluent/DicomServicesClient.java | 287 +++ .../fluent/FhirDestinationsClient.java | 45 + .../fluent/FhirServicesClient.java | 287 +++ .../HealthcareApisManagementClient.java | 80 +- .../IotConnectorFhirDestinationsClient.java | 212 +++ .../fluent/IotConnectorsClient.java | 287 +++ .../fluent/OperationResultsClient.java | 2 +- .../fluent/OperationsClient.java | 14 +- .../PrivateEndpointConnectionsClient.java | 24 +- .../fluent/PrivateLinkResourcesClient.java | 4 +- .../healthcareapis/fluent/ServicesClient.java | 36 +- ...spacePrivateEndpointConnectionsClient.java | 231 +++ .../WorkspacePrivateLinkResourcesClient.java | 75 + .../fluent/WorkspacesClient.java | 268 +++ .../fluent/models/DicomServiceInner.java | 196 +++ .../fluent/models/DicomServiceProperties.java | 138 ++ .../fluent/models/FhirServiceInner.java | 345 ++++ .../fluent/models/FhirServiceProperties.java | 290 +++ .../fluent/models/IotConnectorInner.java | 173 ++ .../fluent/models/IotConnectorProperties.java | 101 ++ .../models/IotFhirDestinationInner.java | 152 ++ .../models/IotFhirDestinationProperties.java | 129 ++ .../fluent/models/OperationDetailInner.java | 149 ++ .../fluent/models/OperationInner.java | 84 - .../OperationResultsDescriptionInner.java | 15 + ...ateEndpointConnectionDescriptionInner.java | 8 +- .../PrivateEndpointConnectionProperties.java | 110 ++ .../PrivateLinkResourceDescriptionInner.java | 8 +- .../models/PrivateLinkResourceProperties.java | 81 + .../ServicesPropertiesUpdateParameters.java | 54 + .../fluent/models/WorkspaceInner.java | 95 + .../implementation/DicomServiceImpl.java | 245 +++ .../DicomServicesClientImpl.java | 1481 ++++++++++++++++ .../implementation/DicomServicesImpl.java | 191 ++ .../FhirDestinationsClientImpl.java | 364 ++++ .../implementation/FhirDestinationsImpl.java | 51 + .../implementation/FhirServiceImpl.java | 312 ++++ .../FhirServicesClientImpl.java | 1473 ++++++++++++++++ .../implementation/FhirServicesImpl.java | 189 ++ .../HealthcareApisManagementClientImpl.java | 166 +- ...otConnectorFhirDestinationsClientImpl.java | 983 +++++++++++ .../IotConnectorFhirDestinationsImpl.java | 230 +++ .../implementation/IotConnectorImpl.java | 230 +++ .../IotConnectorsClientImpl.java | 1477 ++++++++++++++++ .../implementation/IotConnectorsImpl.java | 191 ++ .../IotFhirDestinationImpl.java | 220 +++ ...tionImpl.java => OperationDetailImpl.java} | 33 +- .../OperationResultsClientImpl.java | 10 +- .../OperationResultsDescriptionImpl.java | 4 + .../implementation/OperationsClientImpl.java | 60 +- .../implementation/OperationsImpl.java | 16 +- .../PrivateEndpointConnectionsClientImpl.java | 84 +- .../PrivateLinkResourcesClientImpl.java | 21 +- .../implementation/ServicesClientImpl.java | 138 +- .../implementation/WorkspaceImpl.java | 194 ++ ...ePrivateEndpointConnectionsClientImpl.java | 1117 ++++++++++++ ...rkspacePrivateEndpointConnectionsImpl.java | 123 ++ ...rkspacePrivateLinkResourcesClientImpl.java | 436 +++++ .../WorkspacePrivateLinkResourcesImpl.java | 78 + .../implementation/WorkspacesClientImpl.java | 1567 +++++++++++++++++ .../implementation/WorkspacesImpl.java | 170 ++ .../healthcareapis/models/ActionType.java | 31 + .../healthcareapis/models/DicomService.java | 312 ++++ ...comServiceAuthenticationConfiguration.java | 55 + .../models/DicomServiceCollection.java | 81 + .../models/DicomServicePatchResource.java | 64 + .../healthcareapis/models/DicomServices.java | 142 ++ .../models/FhirDestinations.java | 40 + .../models/FhirResourceVersionPolicy.java | 37 + .../healthcareapis/models/FhirService.java | 421 +++++ .../models/FhirServiceAccessPolicyEntry.java | 57 + .../models/FhirServiceAcrConfiguration.java | 80 + ...hirServiceAuthenticationConfiguration.java | 102 ++ .../models/FhirServiceCollection.java | 81 + .../models/FhirServiceCorsConfiguration.java | 155 ++ .../FhirServiceExportConfiguration.java | 50 + .../models/FhirServiceKind.java | 34 + .../models/FhirServicePatchResource.java | 64 + .../healthcareapis/models/FhirServices.java | 142 ++ .../healthcareapis/models/IotConnector.java | 293 +++ .../models/IotConnectorCollection.java | 81 + .../models/IotConnectorFhirDestinations.java | 130 ++ .../models/IotConnectorPatchResource.java | 64 + .../healthcareapis/models/IotConnectors.java | 142 ++ .../models/IotDestinationProperties.java | 39 + ...ventHubIngestionEndpointConfiguration.java | 103 ++ .../models/IotFhirDestination.java | 297 ++++ .../models/IotFhirDestinationCollection.java | 81 + .../models/IotIdentityResolutionType.java | 34 + .../models/IotMappingProperties.java | 50 + ...ionListResult.java => ListOperations.java} | 48 +- .../models/LocationBasedResource.java | 59 + .../models/LogSpecification.java | 102 ++ .../models/MetricDimension.java | 105 ++ .../models/MetricSpecification.java | 323 ++++ .../healthcareapis/models/Operation.java | 38 - .../models/OperationDetail.java | 61 + .../models/OperationProperties.java | 53 + .../models/OperationResults.java | 2 +- .../models/OperationResultsDescription.java | 7 + .../healthcareapis/models/Operations.java | 12 +- .../models/PrivateEndpointConnection.java | 50 +- .../PrivateEndpointConnectionDescription.java | 2 +- .../models/PrivateEndpointConnections.java | 12 +- .../models/PrivateLinkResource.java | 40 +- .../PrivateLinkResourceDescription.java | 2 +- .../models/PrivateLinkResources.java | 4 +- .../models/ProvisioningState.java | 12 + .../healthcareapis/models/ResourceCore.java | 52 + .../healthcareapis/models/ResourceTags.java | 53 + .../ResourceVersionPolicyConfiguration.java | 80 + .../models/ServiceAcrConfigurationInfo.java | 29 + .../models/ServiceEventState.java | 37 + .../models/ServiceManagedIdentity.java | 54 + .../ServiceManagedIdentityIdentity.java | 142 ++ .../models/ServiceManagedIdentityType.java | 41 + .../models/ServiceOciArtifactEntry.java | 102 ++ .../models/ServiceSpecification.java | 83 + .../healthcareapis/models/Services.java | 16 +- .../models/ServicesPatchDescription.java | 33 +- .../healthcareapis/models/TaggedResource.java | 69 + .../models/UserAssignedIdentity.java | 55 + .../healthcareapis/models/Workspace.java | 236 +++ .../healthcareapis/models/WorkspaceList.java | 81 + .../models/WorkspacePatchResource.java | 33 + .../WorkspacePrivateEndpointConnections.java | 139 ++ .../models/WorkspacePrivateLinkResources.java | 68 + .../models/WorkspaceProperties.java | 89 + .../healthcareapis/models/Workspaces.java | 155 ++ .../DicomServicesCreateOrUpdateSamples.java | 26 + .../generated/DicomServicesDeleteSamples.java | 22 + .../generated/DicomServicesGetSamples.java | 22 + .../DicomServicesListByWorkspaceSamples.java | 22 + .../generated/DicomServicesUpdateSamples.java | 38 + ...DestinationsListByIotConnectorSamples.java | 22 + .../FhirServicesCreateOrUpdateSamples.java | 72 + .../generated/FhirServicesDeleteSamples.java | 22 + .../generated/FhirServicesGetSamples.java | 22 + .../FhirServicesListByWorkspaceSamples.java | 22 + .../generated/FhirServicesUpdateSamples.java | 38 + ...rFhirDestinationCreateOrUpdateSamples.java | 45 + ...ConnectorFhirDestinationDeleteSamples.java | 23 + ...IotConnectorFhirDestinationGetSamples.java | 23 + .../IotConnectorsCreateOrUpdateSamples.java | 63 + .../generated/IotConnectorsDeleteSamples.java | 22 + .../generated/IotConnectorsGetSamples.java | 22 + .../IotConnectorsListByWorkspaceSamples.java | 22 + .../generated/IotConnectorsUpdateSamples.java | 44 + .../generated/OperationResultsGetSamples.java | 22 + .../generated/OperationsListSamples.java | 22 + ...pointConnectionsCreateOrUpdateSamples.java | 32 + ...ivateEndpointConnectionsDeleteSamples.java | 23 + .../PrivateEndpointConnectionsGetSamples.java | 23 + ...dpointConnectionsListByServiceSamples.java | 23 + .../PrivateLinkResourcesGetSamples.java | 22 + ...vateLinkResourcesListByServiceSamples.java | 23 + .../ServicesCheckNameAvailabilitySamples.java | 29 + .../ServicesCreateOrUpdateSamples.java | 107 ++ .../generated/ServicesDeleteSamples.java | 22 + .../ServicesGetByResourceGroupSamples.java | 22 + .../ServicesListByResourceGroupSamples.java | 23 + .../generated/ServicesListSamples.java | 23 + .../generated/ServicesUpdateSamples.java | 38 + ...pointConnectionsCreateOrUpdateSamples.java | 37 + ...ivateEndpointConnectionsDeleteSamples.java | 23 + ...ePrivateEndpointConnectionsGetSamples.java | 25 + ...ointConnectionsListByWorkspaceSamples.java | 23 + ...rkspacePrivateLinkResourcesGetSamples.java | 25 + ...teLinkResourcesListByWorkspaceSamples.java | 23 + .../WorkspacesCreateOrUpdateSamples.java | 29 + .../generated/WorkspacesDeleteSamples.java | 22 + .../WorkspacesGetByResourceGroupSamples.java | 22 + .../WorkspacesListByResourceGroupSamples.java | 23 + .../generated/WorkspacesListSamples.java | 23 + .../generated/WorkspacesUpdateSamples.java | 38 + 180 files changed, 24177 insertions(+), 542 deletions(-) create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/SAMPLE.md create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/DicomServicesClient.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/FhirDestinationsClient.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/FhirServicesClient.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/IotConnectorFhirDestinationsClient.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/IotConnectorsClient.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacePrivateEndpointConnectionsClient.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacePrivateLinkResourcesClient.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacesClient.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceInner.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceProperties.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceInner.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceProperties.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorInner.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorProperties.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotFhirDestinationInner.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotFhirDestinationProperties.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationDetailInner.java delete mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationInner.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateLinkResourceProperties.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/ServicesPropertiesUpdateParameters.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/WorkspaceInner.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServiceImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServicesClientImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServicesImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirDestinationsClientImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirDestinationsImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServiceImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServicesClientImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServicesImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorFhirDestinationsClientImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorFhirDestinationsImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorsClientImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorsImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotFhirDestinationImpl.java rename sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/{OperationImpl.java => OperationDetailImpl.java} (57%) create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspaceImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateEndpointConnectionsImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateLinkResourcesClientImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateLinkResourcesImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesClientImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesImpl.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ActionType.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomService.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServiceAuthenticationConfiguration.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServiceCollection.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServicePatchResource.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServices.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirDestinations.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirResourceVersionPolicy.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirService.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAccessPolicyEntry.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAcrConfiguration.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAuthenticationConfiguration.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceCollection.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceCorsConfiguration.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceExportConfiguration.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceKind.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServicePatchResource.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServices.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnector.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorCollection.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorFhirDestinations.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorPatchResource.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectors.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotDestinationProperties.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotEventHubIngestionEndpointConfiguration.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotFhirDestination.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotFhirDestinationCollection.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotIdentityResolutionType.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotMappingProperties.java rename sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/{OperationListResult.java => ListOperations.java} (59%) create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/LocationBasedResource.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/LogSpecification.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/MetricDimension.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/MetricSpecification.java delete mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operation.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationDetail.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationProperties.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ResourceCore.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ResourceTags.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ResourceVersionPolicyConfiguration.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceEventState.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentity.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentityIdentity.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentityType.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceOciArtifactEntry.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceSpecification.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/TaggedResource.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/UserAssignedIdentity.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspace.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceList.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePatchResource.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePrivateEndpointConnections.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePrivateLinkResources.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceProperties.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspaces.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesCreateOrUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesDeleteSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesGetSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesListByWorkspaceSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirDestinationsListByIotConnectorSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesCreateOrUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesDeleteSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesGetSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesListByWorkspaceSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationCreateOrUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationDeleteSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationGetSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsCreateOrUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsDeleteSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsGetSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsListByWorkspaceSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/OperationResultsGetSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/OperationsListSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsListByServiceSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateLinkResourcesGetSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateLinkResourcesListByServiceSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesCheckNameAvailabilitySamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesCreateOrUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesDeleteSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesGetByResourceGroupSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesListByResourceGroupSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesListSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsListByWorkspaceSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateLinkResourcesGetSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateLinkResourcesListByWorkspaceSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesCreateOrUpdateSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesDeleteSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesGetByResourceGroupSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesListByResourceGroupSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesListSamples.java create mode 100644 sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesUpdateSamples.java diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/CHANGELOG.md b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/CHANGELOG.md index 3b362e298081..3e47790a6018 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/CHANGELOG.md +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-02-28) +- Azure Resource Manager HealthcareApis client library for Java. This package contains Microsoft Azure SDK for HealthcareApis Management SDK. Azure Healthcare APIs Client. Package tag package-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-15) diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/README.md b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/README.md index 6127a609a5bd..1b50ea8033d7 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/README.md +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HealthcareApis client library for Java. -This package contains Microsoft Azure SDK for HealthcareApis Management SDK. Azure Healthcare APIs Client. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for HealthcareApis Management SDK. Azure Healthcare APIs Client. Package tag package-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-healthcareapis - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/healthcareapis/azure-resourcemanager-healthcareapis/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/SAMPLE.md b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/SAMPLE.md new file mode 100644 index 000000000000..438daeaf7ac1 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/SAMPLE.md @@ -0,0 +1,1400 @@ +# Code snippets and samples + + +## DicomServices + +- [CreateOrUpdate](#dicomservices_createorupdate) +- [Delete](#dicomservices_delete) +- [Get](#dicomservices_get) +- [ListByWorkspace](#dicomservices_listbyworkspace) +- [Update](#dicomservices_update) + +## FhirDestinations + +- [ListByIotConnector](#fhirdestinations_listbyiotconnector) + +## FhirServices + +- [CreateOrUpdate](#fhirservices_createorupdate) +- [Delete](#fhirservices_delete) +- [Get](#fhirservices_get) +- [ListByWorkspace](#fhirservices_listbyworkspace) +- [Update](#fhirservices_update) + +## IotConnectorFhirDestination + +- [CreateOrUpdate](#iotconnectorfhirdestination_createorupdate) +- [Delete](#iotconnectorfhirdestination_delete) +- [Get](#iotconnectorfhirdestination_get) + +## IotConnectors + +- [CreateOrUpdate](#iotconnectors_createorupdate) +- [Delete](#iotconnectors_delete) +- [Get](#iotconnectors_get) +- [ListByWorkspace](#iotconnectors_listbyworkspace) +- [Update](#iotconnectors_update) + +## OperationResults + +- [Get](#operationresults_get) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByService](#privateendpointconnections_listbyservice) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [ListByService](#privatelinkresources_listbyservice) + +## Services + +- [CheckNameAvailability](#services_checknameavailability) +- [CreateOrUpdate](#services_createorupdate) +- [Delete](#services_delete) +- [GetByResourceGroup](#services_getbyresourcegroup) +- [List](#services_list) +- [ListByResourceGroup](#services_listbyresourcegroup) +- [Update](#services_update) + +## WorkspacePrivateEndpointConnections + +- [CreateOrUpdate](#workspaceprivateendpointconnections_createorupdate) +- [Delete](#workspaceprivateendpointconnections_delete) +- [Get](#workspaceprivateendpointconnections_get) +- [ListByWorkspace](#workspaceprivateendpointconnections_listbyworkspace) + +## WorkspacePrivateLinkResources + +- [Get](#workspaceprivatelinkresources_get) +- [ListByWorkspace](#workspaceprivatelinkresources_listbyworkspace) + +## Workspaces + +- [CreateOrUpdate](#workspaces_createorupdate) +- [Delete](#workspaces_delete) +- [GetByResourceGroup](#workspaces_getbyresourcegroup) +- [List](#workspaces_list) +- [ListByResourceGroup](#workspaces_listbyresourcegroup) +- [Update](#workspaces_update) +### DicomServices_CreateOrUpdate + +```java +/** Samples for DicomServices CreateOrUpdate. */ +public final class DicomServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Create.json + */ + /** + * Sample code: Create or update a Dicom Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateADicomService( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .dicomServices() + .define("blue") + .withExistingWorkspace("testRG", "workspace1") + .withRegion("westus") + .create(); + } +} +``` + +### DicomServices_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DicomServices Delete. */ +public final class DicomServicesDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Delete.json + */ + /** + * Sample code: Delete a dicomservice. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteADicomservice(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.dicomServices().delete("testRG", "blue", "workspace1", Context.NONE); + } +} +``` + +### DicomServices_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DicomServices Get. */ +public final class DicomServicesGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Get.json + */ + /** + * Sample code: Get a dicomservice. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getADicomservice(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.dicomServices().getWithResponse("testRG", "workspace1", "blue", Context.NONE); + } +} +``` + +### DicomServices_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for DicomServices ListByWorkspace. */ +public final class DicomServicesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_List.json + */ + /** + * Sample code: List dicomservices. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listDicomservices(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.dicomServices().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} +``` + +### DicomServices_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.DicomService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DicomServices Update. */ +public final class DicomServicesUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Patch.json + */ + /** + * Sample code: Update a dicomservice. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void updateADicomservice(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + DicomService resource = + manager.dicomServices().getWithResponse("testRG", "workspace1", "blue", Context.NONE).getValue(); + resource.update().withTags(mapOf("tagKey", "tagValue")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FhirDestinations_ListByIotConnector + +```java +import com.azure.core.util.Context; + +/** Samples for FhirDestinations ListByIotConnector. */ +public final class FhirDestinationsListByIotConnectorSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_List.json + */ + /** + * Sample code: List IoT Connectors. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listIoTConnectors(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.fhirDestinations().listByIotConnector("testRG", "workspace1", "blue", Context.NONE); + } +} +``` + +### FhirServices_CreateOrUpdate + +```java +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAccessPolicyEntry; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAcrConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAuthenticationConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceCorsConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceExportConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceKind; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FhirServices CreateOrUpdate. */ +public final class FhirServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Create.json + */ + /** + * Sample code: Create or update a Fhir Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAFhirService( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .fhirServices() + .define("fhirservice1") + .withExistingWorkspace("testRG", "workspace1") + .withRegion("westus") + .withTags(mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withKind(FhirServiceKind.FHIR_R4) + .withIdentity(new ServiceManagedIdentityIdentity().withType(ServiceManagedIdentityType.SYSTEM_ASSIGNED)) + .withAccessPolicies( + Arrays + .asList( + new FhirServiceAccessPolicyEntry().withObjectId("c487e7d1-3210-41a3-8ccc-e9372b78da47"), + new FhirServiceAccessPolicyEntry().withObjectId("5b307da8-43d4-492b-8b66-b0294ade872f"))) + .withAcrConfiguration(new FhirServiceAcrConfiguration().withLoginServers(Arrays.asList("test1.azurecr.io"))) + .withAuthenticationConfiguration( + new FhirServiceAuthenticationConfiguration() + .withAuthority("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc") + .withAudience("https://azurehealthcareapis.com") + .withSmartProxyEnabled(true)) + .withCorsConfiguration( + new FhirServiceCorsConfiguration() + .withOrigins(Arrays.asList("*")) + .withHeaders(Arrays.asList("*")) + .withMethods(Arrays.asList("DELETE", "GET", "OPTIONS", "PATCH", "POST", "PUT")) + .withMaxAge(1440) + .withAllowCredentials(false)) + .withExportConfiguration( + new FhirServiceExportConfiguration().withStorageAccountName("existingStorageAccount")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FhirServices_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for FhirServices Delete. */ +public final class FhirServicesDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Delete.json + */ + /** + * Sample code: Delete a Fhir Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteAFhirService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.fhirServices().delete("testRG", "fhirservice1", "workspace1", Context.NONE); + } +} +``` + +### FhirServices_Get + +```java +import com.azure.core.util.Context; + +/** Samples for FhirServices Get. */ +public final class FhirServicesGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Get.json + */ + /** + * Sample code: Get a Fhir Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getAFhirService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.fhirServices().getWithResponse("testRG", "workspace1", "fhirservices1", Context.NONE); + } +} +``` + +### FhirServices_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for FhirServices ListByWorkspace. */ +public final class FhirServicesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_List.json + */ + /** + * Sample code: List fhirservices. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listFhirservices(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.fhirServices().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} +``` + +### FhirServices_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.FhirService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FhirServices Update. */ +public final class FhirServicesUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Patch.json + */ + /** + * Sample code: Update a Fhir Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void updateAFhirService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + FhirService resource = + manager.fhirServices().getWithResponse("testRG", "workspace1", "fhirservice1", Context.NONE).getValue(); + resource.update().withTags(mapOf("tagKey", "tagValue")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### IotConnectorFhirDestination_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.healthcareapis.models.IotIdentityResolutionType; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; +import java.io.IOException; + +/** Samples for IotConnectorFhirDestination CreateOrUpdate. */ +public final class IotConnectorFhirDestinationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Create.json + */ + /** + * Sample code: Create or update an Iot Connector FHIR destination. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAnIotConnectorFHIRDestination( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) throws IOException { + manager + .iotConnectorFhirDestinations() + .define("dest1") + .withExistingIotconnector("testRG", "workspace1", "blue") + .withResourceIdentityResolutionType(IotIdentityResolutionType.CREATE) + .withFhirServiceResourceId( + "subscriptions/11111111-2222-3333-4444-555566667777/resourceGroups/myrg/providers/Microsoft.HealthcareApis/workspaces/myworkspace/fhirservices/myfhirservice") + .withFhirMapping( + new IotMappingProperties() + .withContent( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"template\":[{\"template\":{\"codes\":[{\"code\":\"8867-4\",\"display\":\"Heart" + + " rate\",\"system\":\"http://loinc.org\"}],\"periodInterval\":60,\"typeName\":\"heartrate\",\"value\":{\"defaultPeriod\":5000,\"unit\":\"count/min\",\"valueName\":\"hr\",\"valueType\":\"SampledData\"}},\"templateType\":\"CodeValueFhir\"}],\"templateType\":\"CollectionFhirTemplate\"}", + Object.class, + SerializerEncoding.JSON))) + .withRegion("westus") + .create(); + } +} +``` + +### IotConnectorFhirDestination_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for IotConnectorFhirDestination Delete. */ +public final class IotConnectorFhirDestinationDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Delete.json + */ + /** + * Sample code: Delete an IoT Connector destination. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteAnIoTConnectorDestination( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectorFhirDestinations().delete("testRG", "workspace1", "blue", "dest1", Context.NONE); + } +} +``` + +### IotConnectorFhirDestination_Get + +```java +import com.azure.core.util.Context; + +/** Samples for IotConnectorFhirDestination Get. */ +public final class IotConnectorFhirDestinationGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Get.json + */ + /** + * Sample code: Get an IoT Connector destination. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getAnIoTConnectorDestination( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectorFhirDestinations().getWithResponse("testRG", "workspace1", "blue", "dest1", Context.NONE); + } +} +``` + +### IotConnectors_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.healthcareapis.models.IotEventHubIngestionEndpointConfiguration; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityType; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotConnectors CreateOrUpdate. */ +public final class IotConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Create.json + */ + /** + * Sample code: Create an IoT Connector. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createAnIoTConnector(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) + throws IOException { + manager + .iotConnectors() + .define("blue") + .withExistingWorkspace("testRG", "workspace1") + .withRegion("westus") + .withTags(mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withIdentity(new ServiceManagedIdentityIdentity().withType(ServiceManagedIdentityType.SYSTEM_ASSIGNED)) + .withIngestionEndpointConfiguration( + new IotEventHubIngestionEndpointConfiguration() + .withEventHubName("MyEventHubName") + .withConsumerGroup("ConsumerGroupA") + .withFullyQualifiedEventHubNamespace("myeventhub.servicesbus.windows.net")) + .withDeviceMapping( + new IotMappingProperties() + .withContent( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"template\":[{\"template\":{\"deviceIdExpression\":\"$.deviceid\",\"timestampExpression\":\"$.measurementdatetime\",\"typeMatchExpression\":\"$..[?(@heartrate)]\",\"typeName\":\"heartrate\",\"values\":[{\"required\":\"true\",\"valueExpression\":\"$.heartrate\",\"valueName\":\"hr\"}]},\"templateType\":\"JsonPathContent\"}],\"templateType\":\"CollectionContent\"}", + Object.class, + SerializerEncoding.JSON))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### IotConnectors_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for IotConnectors Delete. */ +public final class IotConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Delete.json + */ + /** + * Sample code: Delete an IoT Connector. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteAnIoTConnector(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectors().delete("testRG", "blue", "workspace1", Context.NONE); + } +} +``` + +### IotConnectors_Get + +```java +import com.azure.core.util.Context; + +/** Samples for IotConnectors Get. */ +public final class IotConnectorsGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Get.json + */ + /** + * Sample code: Get an IoT Connector. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getAnIoTConnector(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectors().getWithResponse("testRG", "workspace1", "blue", Context.NONE); + } +} +``` + +### IotConnectors_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for IotConnectors ListByWorkspace. */ +public final class IotConnectorsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_List.json + */ + /** + * Sample code: List iotconnectors. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listIotconnectors(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectors().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} +``` + +### IotConnectors_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.IotConnector; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotConnectors Update. */ +public final class IotConnectorsUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Patch.json + */ + /** + * Sample code: Patch an IoT Connector. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void patchAnIoTConnector(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + IotConnector resource = + manager.iotConnectors().getWithResponse("testRG", "workspace1", "blue", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withIdentity(new ServiceManagedIdentityIdentity().withType(ServiceManagedIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OperationResults Get. */ +public final class OperationResultsGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/OperationResultsGet.json + */ + /** + * Sample code: Get operation result. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getOperationResult(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.operationResults().getWithResponse("westus", "exampleid", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/OperationsList.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listOperations(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.healthcareapis.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreatePrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_CreateOrUpdate. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .privateEndpointConnections() + .define("myConnection") + .withExistingService("rgname", "service1") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceDeletePrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateEndpointConnectionsDelete( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateEndpointConnections().delete("rgname", "service1", "myConnection", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceGetPrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_GetConnection. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateEndpointConnectionGetConnection( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateEndpointConnections().getWithResponse("rgname", "service1", "myConnection", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByService + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByService. */ +public final class PrivateEndpointConnectionsListByServiceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceListPrivateEndpointConnections.json + */ + /** + * Sample code: PrivateEndpointConnection_List. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateEndpointConnectionList( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateEndpointConnections().listByService("rgname", "service1", Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/PrivateLinkResourceGet.json + */ + /** + * Sample code: PrivateLinkResources_Get. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateLinkResourcesGet(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateLinkResources().getWithResponse("rgname", "service1", "fhir", Context.NONE); + } +} +``` + +### PrivateLinkResources_ListByService + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByService. */ +public final class PrivateLinkResourcesListByServiceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/PrivateLinkResourcesListByService.json + */ + /** + * Sample code: PrivateLinkResources_ListGroupIds. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateLinkResourcesListGroupIds( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateLinkResources().listByServiceWithResponse("rgname", "service1", Context.NONE); + } +} +``` + +### Services_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.CheckNameAvailabilityParameters; + +/** Samples for Services CheckNameAvailability. */ +public final class ServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/CheckNameAvailabilityPost.json + */ + /** + * Sample code: Check name availability. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void checkNameAvailability(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .services() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityParameters() + .withName("serviceName") + .withType("Microsoft.HealthcareApis/services"), + Context.NONE); + } +} +``` + +### Services_CreateOrUpdate + +```java +import com.azure.resourcemanager.healthcareapis.models.Kind; +import com.azure.resourcemanager.healthcareapis.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.healthcareapis.models.PublicNetworkAccess; +import com.azure.resourcemanager.healthcareapis.models.ServiceAccessPolicyEntry; +import com.azure.resourcemanager.healthcareapis.models.ServiceAuthenticationConfigurationInfo; +import com.azure.resourcemanager.healthcareapis.models.ServiceCorsConfigurationInfo; +import com.azure.resourcemanager.healthcareapis.models.ServiceCosmosDbConfigurationInfo; +import com.azure.resourcemanager.healthcareapis.models.ServiceExportConfigurationInfo; +import com.azure.resourcemanager.healthcareapis.models.ServicesProperties; +import com.azure.resourcemanager.healthcareapis.models.ServicesResourceIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services CreateOrUpdate. */ +public final class ServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreate.json + */ + /** + * Sample code: Create or Update a service with all parameters. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAServiceWithAllParameters( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .services() + .define("service1") + .withRegion("westus2") + .withExistingResourceGroup("rg1") + .withKind(Kind.FHIR_R4) + .withTags(mapOf()) + .withIdentity(new ServicesResourceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withProperties( + new ServicesProperties() + .withAccessPolicies( + Arrays + .asList( + new ServiceAccessPolicyEntry().withObjectId("c487e7d1-3210-41a3-8ccc-e9372b78da47"), + new ServiceAccessPolicyEntry().withObjectId("5b307da8-43d4-492b-8b66-b0294ade872f"))) + .withCosmosDbConfiguration( + new ServiceCosmosDbConfigurationInfo() + .withOfferThroughput(1000) + .withKeyVaultKeyUri("https://my-vault.vault.azure.net/keys/my-key")) + .withAuthenticationConfiguration( + new ServiceAuthenticationConfigurationInfo() + .withAuthority("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc") + .withAudience("https://azurehealthcareapis.com") + .withSmartProxyEnabled(true)) + .withCorsConfiguration( + new ServiceCorsConfigurationInfo() + .withOrigins(Arrays.asList("*")) + .withHeaders(Arrays.asList("*")) + .withMethods(Arrays.asList("DELETE", "GET", "OPTIONS", "PATCH", "POST", "PUT")) + .withMaxAge(1440) + .withAllowCredentials(false)) + .withExportConfiguration( + new ServiceExportConfigurationInfo().withStorageAccountName("existingStorageAccount")) + .withPrivateEndpointConnections(Arrays.asList()) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) + .create(); + } + + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreateMinimum.json + */ + /** + * Sample code: Create or Update a service with minimum parameters. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAServiceWithMinimumParameters( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .services() + .define("service2") + .withRegion("westus2") + .withExistingResourceGroup("rg1") + .withKind(Kind.FHIR_R4) + .withTags(mapOf()) + .withProperties( + new ServicesProperties() + .withAccessPolicies( + Arrays + .asList( + new ServiceAccessPolicyEntry().withObjectId("c487e7d1-3210-41a3-8ccc-e9372b78da47")))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Services_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceDelete.json + */ + /** + * Sample code: Delete service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.services().delete("rg1", "service1", Context.NONE); + } +} +``` + +### Services_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Services GetByResourceGroup. */ +public final class ServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceGet.json + */ + /** + * Sample code: Get metadata. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getMetadata(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.services().getByResourceGroupWithResponse("rg1", "service1", Context.NONE); + } +} +``` + +### Services_List + +```java +import com.azure.core.util.Context; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceList.json + */ + /** + * Sample code: List all services in subscription. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listAllServicesInSubscription( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.services().list(Context.NONE); + } +} +``` + +### Services_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Services ListByResourceGroup. */ +public final class ServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceListByResourceGroup.json + */ + /** + * Sample code: List all services in resource group. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listAllServicesInResourceGroup( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.services().listByResourceGroup("rgname", Context.NONE); + } +} +``` + +### Services_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.ServicesDescription; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services Update. */ +public final class ServicesUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServicePatch.json + */ + /** + * Sample code: Patch service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void patchService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + ServicesDescription resource = + manager.services().getByResourceGroupWithResponse("rg1", "service1", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### WorkspacePrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateEndpointConnectionDescriptionInner; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.healthcareapis.models.PrivateLinkServiceConnectionState; + +/** Samples for WorkspacePrivateEndpointConnections CreateOrUpdate. */ +public final class WorkspacePrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceCreatePrivateEndpointConnection.json + */ + /** + * Sample code: WorkspacePrivateEndpointConnection_CreateOrUpdate. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .workspacePrivateEndpointConnections() + .createOrUpdate( + "testRG", + "workspace1", + "myConnection", + new PrivateEndpointConnectionDescriptionInner() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")), + Context.NONE); + } +} +``` + +### WorkspacePrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateEndpointConnections Delete. */ +public final class WorkspacePrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceDeletePrivateEndpointConnection.json + */ + /** + * Sample code: WorkspacePrivateEndpointConnections_Delete. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateEndpointConnectionsDelete( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspacePrivateEndpointConnections().delete("testRG", "workspace1", "myConnection", Context.NONE); + } +} +``` + +### WorkspacePrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateEndpointConnections Get. */ +public final class WorkspacePrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceGetPrivateEndpointConnection.json + */ + /** + * Sample code: WorkspacePrivateEndpointConnection_GetConnection. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateEndpointConnectionGetConnection( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .workspacePrivateEndpointConnections() + .getWithResponse("testRG", "workspace1", "myConnection", Context.NONE); + } +} +``` + +### WorkspacePrivateEndpointConnections_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateEndpointConnections ListByWorkspace. */ +public final class WorkspacePrivateEndpointConnectionsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceListPrivateEndpointConnections.json + */ + /** + * Sample code: WorkspacePrivateEndpointConnection_List. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateEndpointConnectionList( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspacePrivateEndpointConnections().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} +``` + +### WorkspacePrivateLinkResources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateLinkResources Get. */ +public final class WorkspacePrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspacePrivateLinkResourceGet.json + */ + /** + * Sample code: WorkspacePrivateLinkResources_Get. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateLinkResourcesGet( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .workspacePrivateLinkResources() + .getWithResponse("testRG", "workspace1", "healthcareworkspace", Context.NONE); + } +} +``` + +### WorkspacePrivateLinkResources_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateLinkResources ListByWorkspace. */ +public final class WorkspacePrivateLinkResourcesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/PrivateLinkResourcesListByWorkspace.json + */ + /** + * Sample code: WorkspacePrivateLinkResources_ListGroupIds. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateLinkResourcesListGroupIds( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspacePrivateLinkResources().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} +``` + +### Workspaces_CreateOrUpdate + +```java +import com.azure.resourcemanager.healthcareapis.models.WorkspaceProperties; + +/** Samples for Workspaces CreateOrUpdate. */ +public final class WorkspacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Create.json + */ + /** + * Sample code: Create or update a workspace. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAWorkspace( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .workspaces() + .define("workspace1") + .withExistingResourceGroup("testRG") + .withRegion("westus") + .withProperties(new WorkspaceProperties()) + .create(); + } +} +``` + +### Workspaces_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Workspaces Delete. */ +public final class WorkspacesDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Delete.json + */ + /** + * Sample code: Delete a workspace. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteAWorkspace(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspaces().delete("testRG", "workspace1", Context.NONE); + } +} +``` + +### Workspaces_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Workspaces GetByResourceGroup. */ +public final class WorkspacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Get.json + */ + /** + * Sample code: Get workspace. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getWorkspace(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspaces().getByResourceGroupWithResponse("testRG", "workspace1", Context.NONE); + } +} +``` + +### Workspaces_List + +```java +import com.azure.core.util.Context; + +/** Samples for Workspaces List. */ +public final class WorkspacesListSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_ListBySubscription.json + */ + /** + * Sample code: Get workspaces by subscription. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getWorkspacesBySubscription( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspaces().list(Context.NONE); + } +} +``` + +### Workspaces_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Workspaces ListByResourceGroup. */ +public final class WorkspacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_ListByResourceGroup.json + */ + /** + * Sample code: Get workspaces by resource group. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getWorkspacesByResourceGroup( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspaces().listByResourceGroup("testRG", Context.NONE); + } +} +``` + +### Workspaces_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.Workspace; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Workspaces Update. */ +public final class WorkspacesUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Patch.json + */ + /** + * Sample code: Update a workspace. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void updateAWorkspace(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + Workspace resource = + manager.workspaces().getByResourceGroupWithResponse("testRG", "workspace1", Context.NONE).getValue(); + resource.update().withTags(mapOf("tagKey", "tagValue")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml index a61211dabd15..ca38534b81ae 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-healthcareapis - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-healthcareapis + 1.0.0-beta.2 + jar - Microsoft Azure SDK for HealthcareApis Management - This package contains Microsoft Azure SDK for HealthcareApis Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Healthcare APIs Client. Package tag package-2021-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for HealthcareApis Management + This package contains Microsoft Azure SDK for HealthcareApis Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Healthcare APIs Client. Package tag package-2021-11. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.25.0 - - - com.azure - azure-core-management - 1.5.2 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-management + 1.5.2 + + diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/HealthcareApisManager.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/HealthcareApisManager.java index 86d1c785db2d..bcc837fedf63 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/HealthcareApisManager.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/HealthcareApisManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,39 +17,73 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.healthcareapis.fluent.HealthcareApisManagementClient; +import com.azure.resourcemanager.healthcareapis.implementation.DicomServicesImpl; +import com.azure.resourcemanager.healthcareapis.implementation.FhirDestinationsImpl; +import com.azure.resourcemanager.healthcareapis.implementation.FhirServicesImpl; import com.azure.resourcemanager.healthcareapis.implementation.HealthcareApisManagementClientBuilder; +import com.azure.resourcemanager.healthcareapis.implementation.IotConnectorFhirDestinationsImpl; +import com.azure.resourcemanager.healthcareapis.implementation.IotConnectorsImpl; import com.azure.resourcemanager.healthcareapis.implementation.OperationResultsImpl; import com.azure.resourcemanager.healthcareapis.implementation.OperationsImpl; import com.azure.resourcemanager.healthcareapis.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.healthcareapis.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.healthcareapis.implementation.ServicesImpl; +import com.azure.resourcemanager.healthcareapis.implementation.WorkspacePrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.healthcareapis.implementation.WorkspacePrivateLinkResourcesImpl; +import com.azure.resourcemanager.healthcareapis.implementation.WorkspacesImpl; +import com.azure.resourcemanager.healthcareapis.models.DicomServices; +import com.azure.resourcemanager.healthcareapis.models.FhirDestinations; +import com.azure.resourcemanager.healthcareapis.models.FhirServices; +import com.azure.resourcemanager.healthcareapis.models.IotConnectorFhirDestinations; +import com.azure.resourcemanager.healthcareapis.models.IotConnectors; import com.azure.resourcemanager.healthcareapis.models.OperationResults; import com.azure.resourcemanager.healthcareapis.models.Operations; import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnections; import com.azure.resourcemanager.healthcareapis.models.PrivateLinkResources; import com.azure.resourcemanager.healthcareapis.models.Services; +import com.azure.resourcemanager.healthcareapis.models.WorkspacePrivateEndpointConnections; +import com.azure.resourcemanager.healthcareapis.models.WorkspacePrivateLinkResources; +import com.azure.resourcemanager.healthcareapis.models.Workspaces; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to HealthcareApisManager. Azure Healthcare APIs Client. */ public final class HealthcareApisManager { private Services services; - private Operations operations; - - private OperationResults operationResults; - private PrivateEndpointConnections privateEndpointConnections; private PrivateLinkResources privateLinkResources; + private Workspaces workspaces; + + private DicomServices dicomServices; + + private IotConnectors iotConnectors; + + private FhirDestinations fhirDestinations; + + private IotConnectorFhirDestinations iotConnectorFhirDestinations; + + private FhirServices fhirServices; + + private WorkspacePrivateEndpointConnections workspacePrivateEndpointConnections; + + private WorkspacePrivateLinkResources workspacePrivateLinkResources; + + private Operations operations; + + private OperationResults operationResults; + private final HealthcareApisManagementClient clientObject; private HealthcareApisManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -93,6 +127,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -132,6 +167,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -188,20 +234,33 @@ public HealthcareApisManager authenticate(TokenCredential credential, AzureProfi userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -221,22 +280,6 @@ public Services services() { return services; } - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** @return Resource collection API of OperationResults. */ - public OperationResults operationResults() { - if (this.operationResults == null) { - this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); - } - return operationResults; - } - /** @return Resource collection API of PrivateEndpointConnections. */ public PrivateEndpointConnections privateEndpointConnections() { if (this.privateEndpointConnections == null) { @@ -254,6 +297,90 @@ public PrivateLinkResources privateLinkResources() { return privateLinkResources; } + /** @return Resource collection API of Workspaces. */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); + } + return workspaces; + } + + /** @return Resource collection API of DicomServices. */ + public DicomServices dicomServices() { + if (this.dicomServices == null) { + this.dicomServices = new DicomServicesImpl(clientObject.getDicomServices(), this); + } + return dicomServices; + } + + /** @return Resource collection API of IotConnectors. */ + public IotConnectors iotConnectors() { + if (this.iotConnectors == null) { + this.iotConnectors = new IotConnectorsImpl(clientObject.getIotConnectors(), this); + } + return iotConnectors; + } + + /** @return Resource collection API of FhirDestinations. */ + public FhirDestinations fhirDestinations() { + if (this.fhirDestinations == null) { + this.fhirDestinations = new FhirDestinationsImpl(clientObject.getFhirDestinations(), this); + } + return fhirDestinations; + } + + /** @return Resource collection API of IotConnectorFhirDestinations. */ + public IotConnectorFhirDestinations iotConnectorFhirDestinations() { + if (this.iotConnectorFhirDestinations == null) { + this.iotConnectorFhirDestinations = + new IotConnectorFhirDestinationsImpl(clientObject.getIotConnectorFhirDestinations(), this); + } + return iotConnectorFhirDestinations; + } + + /** @return Resource collection API of FhirServices. */ + public FhirServices fhirServices() { + if (this.fhirServices == null) { + this.fhirServices = new FhirServicesImpl(clientObject.getFhirServices(), this); + } + return fhirServices; + } + + /** @return Resource collection API of WorkspacePrivateEndpointConnections. */ + public WorkspacePrivateEndpointConnections workspacePrivateEndpointConnections() { + if (this.workspacePrivateEndpointConnections == null) { + this.workspacePrivateEndpointConnections = + new WorkspacePrivateEndpointConnectionsImpl( + clientObject.getWorkspacePrivateEndpointConnections(), this); + } + return workspacePrivateEndpointConnections; + } + + /** @return Resource collection API of WorkspacePrivateLinkResources. */ + public WorkspacePrivateLinkResources workspacePrivateLinkResources() { + if (this.workspacePrivateLinkResources == null) { + this.workspacePrivateLinkResources = + new WorkspacePrivateLinkResourcesImpl(clientObject.getWorkspacePrivateLinkResources(), this); + } + return workspacePrivateLinkResources; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of OperationResults. */ + public OperationResults operationResults() { + if (this.operationResults == null) { + this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); + } + return operationResults; + } + /** * @return Wrapped service client HealthcareApisManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/DicomServicesClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/DicomServicesClient.java new file mode 100644 index 000000000000..9283603221d7 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/DicomServicesClient.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.models.DicomServiceInner; +import com.azure.resourcemanager.healthcareapis.models.DicomServicePatchResource; + +/** An instance of this class provides access to all the operations defined in DicomServicesClient. */ +public interface DicomServicesClient { + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the properties of the specified DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DicomServiceInner get(String resourceGroupName, String workspaceName, String dicomServiceName); + + /** + * Gets the properties of the specified DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String dicomServiceName, Context context); + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DicomServiceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String dicomServiceName, DicomServiceInner dicomservice); + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DicomServiceInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String dicomServiceName, + DicomServiceInner dicomservice, + Context context); + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DicomServiceInner createOrUpdate( + String resourceGroupName, String workspaceName, String dicomServiceName, DicomServiceInner dicomservice); + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DicomServiceInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String dicomServiceName, + DicomServiceInner dicomservice, + Context context); + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DicomServiceInner> beginUpdate( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource); + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DicomServiceInner> beginUpdate( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource, + Context context); + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DicomServiceInner update( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource); + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DicomServiceInner update( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource, + Context context); + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String dicomServiceName, String workspaceName); + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String dicomServiceName, String workspaceName, Context context); + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dicomServiceName, String workspaceName); + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dicomServiceName, String workspaceName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/FhirDestinationsClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/FhirDestinationsClient.java new file mode 100644 index 000000000000..02a55187f71c --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/FhirDestinationsClient.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner; + +/** An instance of this class provides access to all the operations defined in FhirDestinationsClient. */ +public interface FhirDestinationsClient { + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByIotConnector( + String resourceGroupName, String workspaceName, String iotConnectorName); + + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByIotConnector( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/FhirServicesClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/FhirServicesClient.java new file mode 100644 index 000000000000..5ba6ca70b7b7 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/FhirServicesClient.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.models.FhirServiceInner; +import com.azure.resourcemanager.healthcareapis.models.FhirServicePatchResource; + +/** An instance of this class provides access to all the operations defined in FhirServicesClient. */ +public interface FhirServicesClient { + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the properties of the specified FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FhirServiceInner get(String resourceGroupName, String workspaceName, String fhirServiceName); + + /** + * Gets the properties of the specified FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String fhirServiceName, Context context); + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FhirServiceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String fhirServiceName, FhirServiceInner fhirservice); + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FhirServiceInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String fhirServiceName, + FhirServiceInner fhirservice, + Context context); + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FhirServiceInner createOrUpdate( + String resourceGroupName, String workspaceName, String fhirServiceName, FhirServiceInner fhirservice); + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FhirServiceInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String fhirServiceName, + FhirServiceInner fhirservice, + Context context); + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FhirServiceInner> beginUpdate( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource); + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FhirServiceInner> beginUpdate( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource, + Context context); + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FhirServiceInner update( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource); + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FhirServiceInner update( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource, + Context context); + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String fhirServiceName, String workspaceName); + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String fhirServiceName, String workspaceName, Context context); + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String fhirServiceName, String workspaceName); + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String fhirServiceName, String workspaceName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/HealthcareApisManagementClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/HealthcareApisManagementClient.java index 5a3aa9a9322d..e008967e4687 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/HealthcareApisManagementClient.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/HealthcareApisManagementClient.java @@ -52,30 +52,86 @@ public interface HealthcareApisManagementClient { ServicesClient getServices(); /** - * Gets the OperationsClient object to access its operations. + * Gets the PrivateEndpointConnectionsClient object to access its operations. * - * @return the OperationsClient object. + * @return the PrivateEndpointConnectionsClient object. */ - OperationsClient getOperations(); + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); /** - * Gets the OperationResultsClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the OperationResultsClient object. + * @return the PrivateLinkResourcesClient object. */ - OperationResultsClient getOperationResults(); + PrivateLinkResourcesClient getPrivateLinkResources(); /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. + * Gets the WorkspacesClient object to access its operations. * - * @return the PrivateEndpointConnectionsClient object. + * @return the WorkspacesClient object. */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + WorkspacesClient getWorkspaces(); /** - * Gets the PrivateLinkResourcesClient object to access its operations. + * Gets the DicomServicesClient object to access its operations. * - * @return the PrivateLinkResourcesClient object. + * @return the DicomServicesClient object. */ - PrivateLinkResourcesClient getPrivateLinkResources(); + DicomServicesClient getDicomServices(); + + /** + * Gets the IotConnectorsClient object to access its operations. + * + * @return the IotConnectorsClient object. + */ + IotConnectorsClient getIotConnectors(); + + /** + * Gets the FhirDestinationsClient object to access its operations. + * + * @return the FhirDestinationsClient object. + */ + FhirDestinationsClient getFhirDestinations(); + + /** + * Gets the IotConnectorFhirDestinationsClient object to access its operations. + * + * @return the IotConnectorFhirDestinationsClient object. + */ + IotConnectorFhirDestinationsClient getIotConnectorFhirDestinations(); + + /** + * Gets the FhirServicesClient object to access its operations. + * + * @return the FhirServicesClient object. + */ + FhirServicesClient getFhirServices(); + + /** + * Gets the WorkspacePrivateEndpointConnectionsClient object to access its operations. + * + * @return the WorkspacePrivateEndpointConnectionsClient object. + */ + WorkspacePrivateEndpointConnectionsClient getWorkspacePrivateEndpointConnections(); + + /** + * Gets the WorkspacePrivateLinkResourcesClient object to access its operations. + * + * @return the WorkspacePrivateLinkResourcesClient object. + */ + WorkspacePrivateLinkResourcesClient getWorkspacePrivateLinkResources(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the OperationResultsClient object to access its operations. + * + * @return the OperationResultsClient object. + */ + OperationResultsClient getOperationResults(); } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/IotConnectorFhirDestinationsClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/IotConnectorFhirDestinationsClient.java new file mode 100644 index 000000000000..fdea3131eeef --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/IotConnectorFhirDestinationsClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner; + +/** An instance of this class provides access to all the operations defined in IotConnectorFhirDestinationsClient. */ +public interface IotConnectorFhirDestinationsClient { + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IotFhirDestinationInner get( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName); + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context); + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IotFhirDestinationInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination); + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IotFhirDestinationInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination, + Context context); + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IotFhirDestinationInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination); + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IotFhirDestinationInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination, + Context context); + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName); + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context); + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName); + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/IotConnectorsClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/IotConnectorsClient.java new file mode 100644 index 000000000000..e65f0e19f9b1 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/IotConnectorsClient.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotConnectorInner; +import com.azure.resourcemanager.healthcareapis.models.IotConnectorPatchResource; + +/** An instance of this class provides access to all the operations defined in IotConnectorsClient. */ +public interface IotConnectorsClient { + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the properties of the specified IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IotConnectorInner get(String resourceGroupName, String workspaceName, String iotConnectorName); + + /** + * Gets the properties of the specified IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context); + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IotConnectorInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String iotConnectorName, IotConnectorInner iotConnector); + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IotConnectorInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + IotConnectorInner iotConnector, + Context context); + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IotConnectorInner createOrUpdate( + String resourceGroupName, String workspaceName, String iotConnectorName, IotConnectorInner iotConnector); + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IotConnectorInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + IotConnectorInner iotConnector, + Context context); + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IotConnectorInner> beginUpdate( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource); + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IotConnectorInner> beginUpdate( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource, + Context context); + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IotConnectorInner update( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource); + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IotConnectorInner update( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource, + Context context); + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String iotConnectorName, String workspaceName); + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String iotConnectorName, String workspaceName, Context context); + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String iotConnectorName, String workspaceName); + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String iotConnectorName, String workspaceName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/OperationResultsClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/OperationResultsClient.java index 574af9ac4257..64bbdf7c0f24 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/OperationResultsClient.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/OperationResultsClient.java @@ -34,7 +34,7 @@ public interface OperationResultsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. + * @return the operation result for a long running operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/OperationsClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/OperationsClient.java index 60ab5d2d0cc4..ae922ef771a1 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/OperationsClient.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/OperationsClient.java @@ -8,29 +8,29 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.healthcareapis.fluent.models.OperationInner; +import com.azure.resourcemanager.healthcareapis.fluent.models.OperationDetailInner; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateEndpointConnectionsClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateEndpointConnectionsClient.java index 77e764445147..b0d9b604c70d 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateEndpointConnectionsClient.java @@ -24,7 +24,8 @@ public interface PrivateEndpointConnectionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByService( @@ -39,7 +40,8 @@ PagedIterable listByService( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByService( @@ -72,7 +74,7 @@ PrivateEndpointConnectionDescriptionInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the service. + * @return the specified private endpoint connection associated with the service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -89,9 +91,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -111,9 +113,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -174,9 +176,9 @@ PrivateEndpointConnectionDescriptionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName); @@ -191,9 +193,9 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateLinkResourcesClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateLinkResourcesClient.java index 385a469fa0c3..33210f2b0766 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateLinkResourcesClient.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateLinkResourcesClient.java @@ -35,7 +35,7 @@ public interface PrivateLinkResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a service. + * @return the private link resources that need to be created for a service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listByServiceWithResponse( @@ -65,7 +65,7 @@ Response listByServiceWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource that need to be created for a service. + * @return a private link resource that need to be created for a service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/ServicesClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/ServicesClient.java index 05834993a96b..37c98f5ed1ed 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/ServicesClient.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/ServicesClient.java @@ -40,7 +40,7 @@ public interface ServicesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of a service instance. + * @return the metadata of a service instance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -55,9 +55,9 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link SyncPoller} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServicesDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription); @@ -71,9 +71,9 @@ SyncPoller, ServicesDescriptionInner> begin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link SyncPoller} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServicesDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription, Context context); @@ -117,9 +117,9 @@ ServicesDescriptionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link SyncPoller} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServicesDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription); @@ -133,9 +133,9 @@ SyncPoller, ServicesDescriptionInner> begin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link SyncPoller} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServicesDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -184,9 +184,9 @@ ServicesDescriptionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); /** @@ -198,9 +198,9 @@ ServicesDescriptionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); /** @@ -233,7 +233,7 @@ ServicesDescriptionInner update( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -245,7 +245,7 @@ ServicesDescriptionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -257,7 +257,7 @@ ServicesDescriptionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -270,7 +270,7 @@ ServicesDescriptionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -298,7 +298,7 @@ ServicesNameAvailabilityInfoInner checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given service name is available. + * @return the properties indicating whether a given service name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkNameAvailabilityWithResponse( diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacePrivateEndpointConnectionsClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacePrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..8fe306cf63cd --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacePrivateEndpointConnectionsClient.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateEndpointConnectionDescriptionInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspacePrivateEndpointConnectionsClient. + */ +public interface WorkspacePrivateEndpointConnectionsClient { + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName); + + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionDescriptionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionDescriptionInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties); + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionDescriptionInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties, + Context context); + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionDescriptionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties); + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionDescriptionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties, + Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacePrivateLinkResourcesClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacePrivateLinkResourcesClient.java new file mode 100644 index 000000000000..84504d73e043 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacePrivateLinkResourcesClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateLinkResourceDescriptionInner; + +/** An instance of this class provides access to all the operations defined in WorkspacePrivateLinkResourcesClient. */ +public interface WorkspacePrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a private link resource that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource that need to be created for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceDescriptionInner get(String resourceGroupName, String workspaceName, String groupName); + + /** + * Gets a private link resource that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param groupName The name of the private link resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource that need to be created for a workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String groupName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacesClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacesClient.java new file mode 100644 index 000000000000..eff50ef146bc --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/WorkspacesClient.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.healthcareapis.models.WorkspacePatchResource; + +/** An instance of this class provides access to all the operations defined in WorkspacesClient. */ +public interface WorkspacesClient { + /** + * Lists all the available workspaces under the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the available workspaces under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the properties of the specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName); + + /** + * Gets the properties of the specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspace); + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context); + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspace); + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context); + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WorkspaceInner> beginUpdate( + String resourceGroupName, String workspaceName, WorkspacePatchResource workspacePatchResource); + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WorkspaceInner> beginUpdate( + String resourceGroupName, String workspaceName, WorkspacePatchResource workspacePatchResource, Context context); + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner update( + String resourceGroupName, String workspaceName, WorkspacePatchResource workspacePatchResource); + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner update( + String resourceGroupName, String workspaceName, WorkspacePatchResource workspacePatchResource, Context context); + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName); + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName); + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceInner.java new file mode 100644 index 000000000000..1f814e8a8b8c --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceInner.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.DicomServiceAuthenticationConfiguration; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnection; +import com.azure.resourcemanager.healthcareapis.models.ProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.PublicNetworkAccess; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import com.azure.resourcemanager.healthcareapis.models.TaggedResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The description of Dicom Service. */ +@Fluent +public final class DicomServiceInner extends TaggedResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DicomServiceInner.class); + + /* + * Dicom Service configuration. + */ + @JsonProperty(value = "properties") + private DicomServiceProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Setting indicating whether the service has a managed identity associated + * with it. + */ + @JsonProperty(value = "identity") + private ServiceManagedIdentityIdentity identity; + + /** + * Get the innerProperties property: Dicom Service configuration. + * + * @return the innerProperties value. + */ + private DicomServiceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + public ServiceManagedIdentityIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @param identity the identity value to set. + * @return the DicomServiceInner object itself. + */ + public DicomServiceInner withIdentity(ServiceManagedIdentityIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public DicomServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public DicomServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DicomServiceInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the authenticationConfiguration property: Dicom Service authentication configuration. + * + * @return the authenticationConfiguration value. + */ + public DicomServiceAuthenticationConfiguration authenticationConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().authenticationConfiguration(); + } + + /** + * Set the authenticationConfiguration property: Dicom Service authentication configuration. + * + * @param authenticationConfiguration the authenticationConfiguration value to set. + * @return the DicomServiceInner object itself. + */ + public DicomServiceInner withAuthenticationConfiguration( + DicomServiceAuthenticationConfiguration authenticationConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new DicomServiceProperties(); + } + this.innerProperties().withAuthenticationConfiguration(authenticationConfiguration); + return this; + } + + /** + * Get the serviceUrl property: The url of the Dicom Services. + * + * @return the serviceUrl value. + */ + public String serviceUrl() { + return this.innerProperties() == null ? null : this.innerProperties().serviceUrl(); + } + + /** + * Get the privateEndpointConnections property: The list of private endpoint connections that are set up for this + * resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DicomServiceInner object itself. + */ + public DicomServiceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new DicomServiceProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceProperties.java new file mode 100644 index 000000000000..d0ebd57937d5 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceProperties.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.DicomServiceAuthenticationConfiguration; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnection; +import com.azure.resourcemanager.healthcareapis.models.ProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.PublicNetworkAccess; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dicom Service properties. */ +@Fluent +public final class DicomServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DicomServiceProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Dicom Service authentication configuration. + */ + @JsonProperty(value = "authenticationConfiguration") + private DicomServiceAuthenticationConfiguration authenticationConfiguration; + + /* + * The url of the Dicom Services. + */ + @JsonProperty(value = "serviceUrl", access = JsonProperty.Access.WRITE_ONLY) + private String serviceUrl; + + /* + * The list of private endpoint connections that are set up for this + * resource. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the authenticationConfiguration property: Dicom Service authentication configuration. + * + * @return the authenticationConfiguration value. + */ + public DicomServiceAuthenticationConfiguration authenticationConfiguration() { + return this.authenticationConfiguration; + } + + /** + * Set the authenticationConfiguration property: Dicom Service authentication configuration. + * + * @param authenticationConfiguration the authenticationConfiguration value to set. + * @return the DicomServiceProperties object itself. + */ + public DicomServiceProperties withAuthenticationConfiguration( + DicomServiceAuthenticationConfiguration authenticationConfiguration) { + this.authenticationConfiguration = authenticationConfiguration; + return this; + } + + /** + * Get the serviceUrl property: The url of the Dicom Services. + * + * @return the serviceUrl value. + */ + public String serviceUrl() { + return this.serviceUrl; + } + + /** + * Get the privateEndpointConnections property: The list of private endpoint connections that are set up for this + * resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DicomServiceProperties object itself. + */ + public DicomServiceProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationConfiguration() != null) { + authenticationConfiguration().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceInner.java new file mode 100644 index 000000000000..a7ad1a28d4a2 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceInner.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAccessPolicyEntry; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAcrConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAuthenticationConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceCorsConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceExportConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceKind; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnection; +import com.azure.resourcemanager.healthcareapis.models.ProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.PublicNetworkAccess; +import com.azure.resourcemanager.healthcareapis.models.ResourceVersionPolicyConfiguration; +import com.azure.resourcemanager.healthcareapis.models.ServiceEventState; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import com.azure.resourcemanager.healthcareapis.models.TaggedResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The description of Fhir Service. */ +@Fluent +public final class FhirServiceInner extends TaggedResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServiceInner.class); + + /* + * The kind of the service. + */ + @JsonProperty(value = "kind") + private FhirServiceKind kind; + + /* + * Fhir Service configuration. + */ + @JsonProperty(value = "properties") + private FhirServiceProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Setting indicating whether the service has a managed identity associated + * with it. + */ + @JsonProperty(value = "identity") + private ServiceManagedIdentityIdentity identity; + + /** + * Get the kind property: The kind of the service. + * + * @return the kind value. + */ + public FhirServiceKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the service. + * + * @param kind the kind value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withKind(FhirServiceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the innerProperties property: Fhir Service configuration. + * + * @return the innerProperties value. + */ + private FhirServiceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + public ServiceManagedIdentityIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @param identity the identity value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withIdentity(ServiceManagedIdentityIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public FhirServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public FhirServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public FhirServiceInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the accessPolicies property: Fhir Service access policies. + * + * @return the accessPolicies value. + */ + public List accessPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().accessPolicies(); + } + + /** + * Set the accessPolicies property: Fhir Service access policies. + * + * @param accessPolicies the accessPolicies value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withAccessPolicies(List accessPolicies) { + if (this.innerProperties() == null) { + this.innerProperties = new FhirServiceProperties(); + } + this.innerProperties().withAccessPolicies(accessPolicies); + return this; + } + + /** + * Get the acrConfiguration property: Fhir Service Azure container registry configuration. + * + * @return the acrConfiguration value. + */ + public FhirServiceAcrConfiguration acrConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().acrConfiguration(); + } + + /** + * Set the acrConfiguration property: Fhir Service Azure container registry configuration. + * + * @param acrConfiguration the acrConfiguration value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withAcrConfiguration(FhirServiceAcrConfiguration acrConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new FhirServiceProperties(); + } + this.innerProperties().withAcrConfiguration(acrConfiguration); + return this; + } + + /** + * Get the authenticationConfiguration property: Fhir Service authentication configuration. + * + * @return the authenticationConfiguration value. + */ + public FhirServiceAuthenticationConfiguration authenticationConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().authenticationConfiguration(); + } + + /** + * Set the authenticationConfiguration property: Fhir Service authentication configuration. + * + * @param authenticationConfiguration the authenticationConfiguration value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withAuthenticationConfiguration( + FhirServiceAuthenticationConfiguration authenticationConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new FhirServiceProperties(); + } + this.innerProperties().withAuthenticationConfiguration(authenticationConfiguration); + return this; + } + + /** + * Get the corsConfiguration property: Fhir Service Cors configuration. + * + * @return the corsConfiguration value. + */ + public FhirServiceCorsConfiguration corsConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().corsConfiguration(); + } + + /** + * Set the corsConfiguration property: Fhir Service Cors configuration. + * + * @param corsConfiguration the corsConfiguration value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withCorsConfiguration(FhirServiceCorsConfiguration corsConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new FhirServiceProperties(); + } + this.innerProperties().withCorsConfiguration(corsConfiguration); + return this; + } + + /** + * Get the exportConfiguration property: Fhir Service export configuration. + * + * @return the exportConfiguration value. + */ + public FhirServiceExportConfiguration exportConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().exportConfiguration(); + } + + /** + * Set the exportConfiguration property: Fhir Service export configuration. + * + * @param exportConfiguration the exportConfiguration value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withExportConfiguration(FhirServiceExportConfiguration exportConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new FhirServiceProperties(); + } + this.innerProperties().withExportConfiguration(exportConfiguration); + return this; + } + + /** + * Get the privateEndpointConnections property: The list of private endpoint connections that are set up for this + * resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new FhirServiceProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the eventState property: Fhir Service event support status. + * + * @return the eventState value. + */ + public ServiceEventState eventState() { + return this.innerProperties() == null ? null : this.innerProperties().eventState(); + } + + /** + * Get the resourceVersionPolicyConfiguration property: Determines tracking of history for resources. + * + * @return the resourceVersionPolicyConfiguration value. + */ + public ResourceVersionPolicyConfiguration resourceVersionPolicyConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().resourceVersionPolicyConfiguration(); + } + + /** + * Set the resourceVersionPolicyConfiguration property: Determines tracking of history for resources. + * + * @param resourceVersionPolicyConfiguration the resourceVersionPolicyConfiguration value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withResourceVersionPolicyConfiguration( + ResourceVersionPolicyConfiguration resourceVersionPolicyConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new FhirServiceProperties(); + } + this.innerProperties().withResourceVersionPolicyConfiguration(resourceVersionPolicyConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceProperties.java new file mode 100644 index 000000000000..c3000ba477f4 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceProperties.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAccessPolicyEntry; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAcrConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAuthenticationConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceCorsConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceExportConfiguration; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnection; +import com.azure.resourcemanager.healthcareapis.models.ProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.PublicNetworkAccess; +import com.azure.resourcemanager.healthcareapis.models.ResourceVersionPolicyConfiguration; +import com.azure.resourcemanager.healthcareapis.models.ServiceEventState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Fhir Service properties. */ +@Fluent +public final class FhirServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServiceProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Fhir Service access policies. + */ + @JsonProperty(value = "accessPolicies") + private List accessPolicies; + + /* + * Fhir Service Azure container registry configuration. + */ + @JsonProperty(value = "acrConfiguration") + private FhirServiceAcrConfiguration acrConfiguration; + + /* + * Fhir Service authentication configuration. + */ + @JsonProperty(value = "authenticationConfiguration") + private FhirServiceAuthenticationConfiguration authenticationConfiguration; + + /* + * Fhir Service Cors configuration. + */ + @JsonProperty(value = "corsConfiguration") + private FhirServiceCorsConfiguration corsConfiguration; + + /* + * Fhir Service export configuration. + */ + @JsonProperty(value = "exportConfiguration") + private FhirServiceExportConfiguration exportConfiguration; + + /* + * The list of private endpoint connections that are set up for this + * resource. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Fhir Service event support status. + */ + @JsonProperty(value = "eventState", access = JsonProperty.Access.WRITE_ONLY) + private ServiceEventState eventState; + + /* + * Determines tracking of history for resources. + */ + @JsonProperty(value = "resourceVersionPolicyConfiguration") + private ResourceVersionPolicyConfiguration resourceVersionPolicyConfiguration; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the accessPolicies property: Fhir Service access policies. + * + * @return the accessPolicies value. + */ + public List accessPolicies() { + return this.accessPolicies; + } + + /** + * Set the accessPolicies property: Fhir Service access policies. + * + * @param accessPolicies the accessPolicies value to set. + * @return the FhirServiceProperties object itself. + */ + public FhirServiceProperties withAccessPolicies(List accessPolicies) { + this.accessPolicies = accessPolicies; + return this; + } + + /** + * Get the acrConfiguration property: Fhir Service Azure container registry configuration. + * + * @return the acrConfiguration value. + */ + public FhirServiceAcrConfiguration acrConfiguration() { + return this.acrConfiguration; + } + + /** + * Set the acrConfiguration property: Fhir Service Azure container registry configuration. + * + * @param acrConfiguration the acrConfiguration value to set. + * @return the FhirServiceProperties object itself. + */ + public FhirServiceProperties withAcrConfiguration(FhirServiceAcrConfiguration acrConfiguration) { + this.acrConfiguration = acrConfiguration; + return this; + } + + /** + * Get the authenticationConfiguration property: Fhir Service authentication configuration. + * + * @return the authenticationConfiguration value. + */ + public FhirServiceAuthenticationConfiguration authenticationConfiguration() { + return this.authenticationConfiguration; + } + + /** + * Set the authenticationConfiguration property: Fhir Service authentication configuration. + * + * @param authenticationConfiguration the authenticationConfiguration value to set. + * @return the FhirServiceProperties object itself. + */ + public FhirServiceProperties withAuthenticationConfiguration( + FhirServiceAuthenticationConfiguration authenticationConfiguration) { + this.authenticationConfiguration = authenticationConfiguration; + return this; + } + + /** + * Get the corsConfiguration property: Fhir Service Cors configuration. + * + * @return the corsConfiguration value. + */ + public FhirServiceCorsConfiguration corsConfiguration() { + return this.corsConfiguration; + } + + /** + * Set the corsConfiguration property: Fhir Service Cors configuration. + * + * @param corsConfiguration the corsConfiguration value to set. + * @return the FhirServiceProperties object itself. + */ + public FhirServiceProperties withCorsConfiguration(FhirServiceCorsConfiguration corsConfiguration) { + this.corsConfiguration = corsConfiguration; + return this; + } + + /** + * Get the exportConfiguration property: Fhir Service export configuration. + * + * @return the exportConfiguration value. + */ + public FhirServiceExportConfiguration exportConfiguration() { + return this.exportConfiguration; + } + + /** + * Set the exportConfiguration property: Fhir Service export configuration. + * + * @param exportConfiguration the exportConfiguration value to set. + * @return the FhirServiceProperties object itself. + */ + public FhirServiceProperties withExportConfiguration(FhirServiceExportConfiguration exportConfiguration) { + this.exportConfiguration = exportConfiguration; + return this; + } + + /** + * Get the privateEndpointConnections property: The list of private endpoint connections that are set up for this + * resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the FhirServiceProperties object itself. + */ + public FhirServiceProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the eventState property: Fhir Service event support status. + * + * @return the eventState value. + */ + public ServiceEventState eventState() { + return this.eventState; + } + + /** + * Get the resourceVersionPolicyConfiguration property: Determines tracking of history for resources. + * + * @return the resourceVersionPolicyConfiguration value. + */ + public ResourceVersionPolicyConfiguration resourceVersionPolicyConfiguration() { + return this.resourceVersionPolicyConfiguration; + } + + /** + * Set the resourceVersionPolicyConfiguration property: Determines tracking of history for resources. + * + * @param resourceVersionPolicyConfiguration the resourceVersionPolicyConfiguration value to set. + * @return the FhirServiceProperties object itself. + */ + public FhirServiceProperties withResourceVersionPolicyConfiguration( + ResourceVersionPolicyConfiguration resourceVersionPolicyConfiguration) { + this.resourceVersionPolicyConfiguration = resourceVersionPolicyConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessPolicies() != null) { + accessPolicies().forEach(e -> e.validate()); + } + if (acrConfiguration() != null) { + acrConfiguration().validate(); + } + if (authenticationConfiguration() != null) { + authenticationConfiguration().validate(); + } + if (corsConfiguration() != null) { + corsConfiguration().validate(); + } + if (exportConfiguration() != null) { + exportConfiguration().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (resourceVersionPolicyConfiguration() != null) { + resourceVersionPolicyConfiguration().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorInner.java new file mode 100644 index 000000000000..bf82aa4adf17 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorInner.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.IotEventHubIngestionEndpointConfiguration; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; +import com.azure.resourcemanager.healthcareapis.models.ProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import com.azure.resourcemanager.healthcareapis.models.TaggedResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** IoT Connector definition. */ +@Fluent +public final class IotConnectorInner extends TaggedResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotConnectorInner.class); + + /* + * IoT Connector configuration. + */ + @JsonProperty(value = "properties") + private IotConnectorProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Setting indicating whether the service has a managed identity associated + * with it. + */ + @JsonProperty(value = "identity") + private ServiceManagedIdentityIdentity identity; + + /** + * Get the innerProperties property: IoT Connector configuration. + * + * @return the innerProperties value. + */ + private IotConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + public ServiceManagedIdentityIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @param identity the identity value to set. + * @return the IotConnectorInner object itself. + */ + public IotConnectorInner withIdentity(ServiceManagedIdentityIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public IotConnectorInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public IotConnectorInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IotConnectorInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ingestionEndpointConfiguration property: Source configuration. + * + * @return the ingestionEndpointConfiguration value. + */ + public IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionEndpointConfiguration(); + } + + /** + * Set the ingestionEndpointConfiguration property: Source configuration. + * + * @param ingestionEndpointConfiguration the ingestionEndpointConfiguration value to set. + * @return the IotConnectorInner object itself. + */ + public IotConnectorInner withIngestionEndpointConfiguration( + IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new IotConnectorProperties(); + } + this.innerProperties().withIngestionEndpointConfiguration(ingestionEndpointConfiguration); + return this; + } + + /** + * Get the deviceMapping property: Device Mappings. + * + * @return the deviceMapping value. + */ + public IotMappingProperties deviceMapping() { + return this.innerProperties() == null ? null : this.innerProperties().deviceMapping(); + } + + /** + * Set the deviceMapping property: Device Mappings. + * + * @param deviceMapping the deviceMapping value to set. + * @return the IotConnectorInner object itself. + */ + public IotConnectorInner withDeviceMapping(IotMappingProperties deviceMapping) { + if (this.innerProperties() == null) { + this.innerProperties = new IotConnectorProperties(); + } + this.innerProperties().withDeviceMapping(deviceMapping); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorProperties.java new file mode 100644 index 000000000000..7c1b582160ca --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.IotEventHubIngestionEndpointConfiguration; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; +import com.azure.resourcemanager.healthcareapis.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IoT Connector properties. */ +@Fluent +public final class IotConnectorProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotConnectorProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Source configuration. + */ + @JsonProperty(value = "ingestionEndpointConfiguration") + private IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration; + + /* + * Device Mappings. + */ + @JsonProperty(value = "deviceMapping") + private IotMappingProperties deviceMapping; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ingestionEndpointConfiguration property: Source configuration. + * + * @return the ingestionEndpointConfiguration value. + */ + public IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration() { + return this.ingestionEndpointConfiguration; + } + + /** + * Set the ingestionEndpointConfiguration property: Source configuration. + * + * @param ingestionEndpointConfiguration the ingestionEndpointConfiguration value to set. + * @return the IotConnectorProperties object itself. + */ + public IotConnectorProperties withIngestionEndpointConfiguration( + IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration) { + this.ingestionEndpointConfiguration = ingestionEndpointConfiguration; + return this; + } + + /** + * Get the deviceMapping property: Device Mappings. + * + * @return the deviceMapping value. + */ + public IotMappingProperties deviceMapping() { + return this.deviceMapping; + } + + /** + * Set the deviceMapping property: Device Mappings. + * + * @param deviceMapping the deviceMapping value to set. + * @return the IotConnectorProperties object itself. + */ + public IotConnectorProperties withDeviceMapping(IotMappingProperties deviceMapping) { + this.deviceMapping = deviceMapping; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ingestionEndpointConfiguration() != null) { + ingestionEndpointConfiguration().validate(); + } + if (deviceMapping() != null) { + deviceMapping().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotFhirDestinationInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotFhirDestinationInner.java new file mode 100644 index 000000000000..e29234b74b56 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotFhirDestinationInner.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.IotIdentityResolutionType; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; +import com.azure.resourcemanager.healthcareapis.models.LocationBasedResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IoT Connector FHIR destination definition. */ +@Fluent +public final class IotFhirDestinationInner extends LocationBasedResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotFhirDestinationInner.class); + + /* + * IoT FHIR Destination settings. + */ + @JsonProperty(value = "properties", required = true) + private IotFhirDestinationProperties innerProperties = new IotFhirDestinationProperties(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: IoT FHIR Destination settings. + * + * @return the innerProperties value. + */ + private IotFhirDestinationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public IotFhirDestinationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IotFhirDestinationInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the resourceIdentityResolutionType property: Determines how resource identity is resolved on the destination. + * + * @return the resourceIdentityResolutionType value. + */ + public IotIdentityResolutionType resourceIdentityResolutionType() { + return this.innerProperties() == null ? null : this.innerProperties().resourceIdentityResolutionType(); + } + + /** + * Set the resourceIdentityResolutionType property: Determines how resource identity is resolved on the destination. + * + * @param resourceIdentityResolutionType the resourceIdentityResolutionType value to set. + * @return the IotFhirDestinationInner object itself. + */ + public IotFhirDestinationInner withResourceIdentityResolutionType( + IotIdentityResolutionType resourceIdentityResolutionType) { + if (this.innerProperties() == null) { + this.innerProperties = new IotFhirDestinationProperties(); + } + this.innerProperties().withResourceIdentityResolutionType(resourceIdentityResolutionType); + return this; + } + + /** + * Get the fhirServiceResourceId property: Fully qualified resource id of the FHIR service to connect to. + * + * @return the fhirServiceResourceId value. + */ + public String fhirServiceResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().fhirServiceResourceId(); + } + + /** + * Set the fhirServiceResourceId property: Fully qualified resource id of the FHIR service to connect to. + * + * @param fhirServiceResourceId the fhirServiceResourceId value to set. + * @return the IotFhirDestinationInner object itself. + */ + public IotFhirDestinationInner withFhirServiceResourceId(String fhirServiceResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new IotFhirDestinationProperties(); + } + this.innerProperties().withFhirServiceResourceId(fhirServiceResourceId); + return this; + } + + /** + * Get the fhirMapping property: FHIR Mappings. + * + * @return the fhirMapping value. + */ + public IotMappingProperties fhirMapping() { + return this.innerProperties() == null ? null : this.innerProperties().fhirMapping(); + } + + /** + * Set the fhirMapping property: FHIR Mappings. + * + * @param fhirMapping the fhirMapping value to set. + * @return the IotFhirDestinationInner object itself. + */ + public IotFhirDestinationInner withFhirMapping(IotMappingProperties fhirMapping) { + if (this.innerProperties() == null) { + this.innerProperties = new IotFhirDestinationProperties(); + } + this.innerProperties().withFhirMapping(fhirMapping); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model IotFhirDestinationInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotFhirDestinationProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotFhirDestinationProperties.java new file mode 100644 index 000000000000..2ba80fa071d4 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotFhirDestinationProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.IotDestinationProperties; +import com.azure.resourcemanager.healthcareapis.models.IotIdentityResolutionType; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IoT Connector destination properties for an Azure FHIR service. */ +@Fluent +public final class IotFhirDestinationProperties extends IotDestinationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotFhirDestinationProperties.class); + + /* + * Determines how resource identity is resolved on the destination. + */ + @JsonProperty(value = "resourceIdentityResolutionType", required = true) + private IotIdentityResolutionType resourceIdentityResolutionType; + + /* + * Fully qualified resource id of the FHIR service to connect to. + */ + @JsonProperty(value = "fhirServiceResourceId", required = true) + private String fhirServiceResourceId; + + /* + * FHIR Mappings + */ + @JsonProperty(value = "fhirMapping", required = true) + private IotMappingProperties fhirMapping; + + /** + * Get the resourceIdentityResolutionType property: Determines how resource identity is resolved on the destination. + * + * @return the resourceIdentityResolutionType value. + */ + public IotIdentityResolutionType resourceIdentityResolutionType() { + return this.resourceIdentityResolutionType; + } + + /** + * Set the resourceIdentityResolutionType property: Determines how resource identity is resolved on the destination. + * + * @param resourceIdentityResolutionType the resourceIdentityResolutionType value to set. + * @return the IotFhirDestinationProperties object itself. + */ + public IotFhirDestinationProperties withResourceIdentityResolutionType( + IotIdentityResolutionType resourceIdentityResolutionType) { + this.resourceIdentityResolutionType = resourceIdentityResolutionType; + return this; + } + + /** + * Get the fhirServiceResourceId property: Fully qualified resource id of the FHIR service to connect to. + * + * @return the fhirServiceResourceId value. + */ + public String fhirServiceResourceId() { + return this.fhirServiceResourceId; + } + + /** + * Set the fhirServiceResourceId property: Fully qualified resource id of the FHIR service to connect to. + * + * @param fhirServiceResourceId the fhirServiceResourceId value to set. + * @return the IotFhirDestinationProperties object itself. + */ + public IotFhirDestinationProperties withFhirServiceResourceId(String fhirServiceResourceId) { + this.fhirServiceResourceId = fhirServiceResourceId; + return this; + } + + /** + * Get the fhirMapping property: FHIR Mappings. + * + * @return the fhirMapping value. + */ + public IotMappingProperties fhirMapping() { + return this.fhirMapping; + } + + /** + * Set the fhirMapping property: FHIR Mappings. + * + * @param fhirMapping the fhirMapping value to set. + * @return the IotFhirDestinationProperties object itself. + */ + public IotFhirDestinationProperties withFhirMapping(IotMappingProperties fhirMapping) { + this.fhirMapping = fhirMapping; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (resourceIdentityResolutionType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceIdentityResolutionType in model" + + " IotFhirDestinationProperties")); + } + if (fhirServiceResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fhirServiceResourceId in model IotFhirDestinationProperties")); + } + if (fhirMapping() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fhirMapping in model IotFhirDestinationProperties")); + } else { + fhirMapping().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationDetailInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationDetailInner.java new file mode 100644 index 000000000000..069999752441 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationDetailInner.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.ActionType; +import com.azure.resourcemanager.healthcareapis.models.OperationDisplay; +import com.azure.resourcemanager.healthcareapis.models.OperationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Service REST API operation. */ +@Fluent +public final class OperationDetailInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetailInner.class); + + /* + * Name of the operation + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for + * data-plane operations and "false" for ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Display of the operation + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Default value is 'user,system'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /* + * Properties of the operation + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Display of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display of the operation. + * + * @param display the display value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Default value is 'user,system'. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Get the properties property: Properties of the operation. + * + * @return the properties value. + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operation. + * + * @param properties the properties value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationInner.java deleted file mode 100644 index 664e4171f0b3..000000000000 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationInner.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.healthcareapis.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.healthcareapis.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Service REST API operation. */ -@Fluent -public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - - /* - * Operation name: {provider}/{resource}/{read | write | action | delete} - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Default value is 'user,system'. - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private String origin; - - /* - * The information displayed about the operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /** - * Get the name property: Operation name: {provider}/{resource}/{read | write | action | delete}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the origin property: Default value is 'user,system'. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Get the display property: The information displayed about the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: The information displayed about the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationResultsDescriptionInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationResultsDescriptionInner.java index 2f3d1bcc1f28..aeca4dc53c9a 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationResultsDescriptionInner.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationResultsDescriptionInner.java @@ -39,6 +39,12 @@ public final class OperationResultsDescriptionInner { @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) private String startTime; + /* + * The time that the operation finished. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private String endTime; + /* * Additional properties of the operation result. */ @@ -81,6 +87,15 @@ public String startTime() { return this.startTime; } + /** + * Get the endTime property: The time that the operation finished. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + /** * Get the properties property: Additional properties of the operation result. * diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateEndpointConnectionDescriptionInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateEndpointConnectionDescriptionInner.java index c329e32cbd83..45fd5ab94b70 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateEndpointConnectionDescriptionInner.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateEndpointConnectionDescriptionInner.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.healthcareapis.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.healthcareapis.models.PrivateEndpoint; @@ -14,18 +14,18 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** The Private Endpoint Connection resource. */ -@Immutable +@Fluent public final class PrivateEndpointConnectionDescriptionInner extends PrivateEndpointConnection { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionDescriptionInner.class); /* - * System metadata for this resource. + * Metadata pertaining to creation and last modification of the resource. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /** - * Get the systemData property: System metadata for this resource. + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * * @return the systemData value. */ diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..3dc85065f8cd --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpoint; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateLinkResourceDescriptionInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateLinkResourceDescriptionInner.java index 062a4cc4ece2..128cea8fc200 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateLinkResourceDescriptionInner.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateLinkResourceDescriptionInner.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.healthcareapis.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.healthcareapis.models.PrivateLinkResource; @@ -13,18 +13,18 @@ import java.util.List; /** The Private Endpoint Connection resource. */ -@Immutable +@Fluent public final class PrivateLinkResourceDescriptionInner extends PrivateLinkResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceDescriptionInner.class); /* - * System metadata for this resource. + * Metadata pertaining to creation and last modification of the resource. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /** - * Get the systemData property: System metadata for this resource. + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * * @return the systemData value. */ diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateLinkResourceProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..3cda2b478fcf --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); + + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/ServicesPropertiesUpdateParameters.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/ServicesPropertiesUpdateParameters.java new file mode 100644 index 000000000000..03b0702a96c2 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/ServicesPropertiesUpdateParameters.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.PublicNetworkAccess; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for updating a service instance. */ +@Fluent +public final class ServicesPropertiesUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesPropertiesUpdateParameters.class); + + /* + * Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ServicesPropertiesUpdateParameters object itself. + */ + public ServicesPropertiesUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/WorkspaceInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/WorkspaceInner.java new file mode 100644 index 000000000000..cbd5be2bae73 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/WorkspaceInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.models.TaggedResource; +import com.azure.resourcemanager.healthcareapis.models.WorkspaceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Workspace resource. */ +@Fluent +public final class WorkspaceInner extends TaggedResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceInner.class); + + /* + * Workspaces resource specific properties. + */ + @JsonProperty(value = "properties") + private WorkspaceProperties properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: Workspaces resource specific properties. + * + * @return the properties value. + */ + public WorkspaceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Workspaces resource specific properties. + * + * @param properties the properties value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withProperties(WorkspaceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public WorkspaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkspaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkspaceInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServiceImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServiceImpl.java new file mode 100644 index 000000000000..ec4109244d4e --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServiceImpl.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.DicomServiceInner; +import com.azure.resourcemanager.healthcareapis.models.DicomService; +import com.azure.resourcemanager.healthcareapis.models.DicomServiceAuthenticationConfiguration; +import com.azure.resourcemanager.healthcareapis.models.DicomServicePatchResource; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnection; +import com.azure.resourcemanager.healthcareapis.models.ProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.PublicNetworkAccess; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DicomServiceImpl implements DicomService, DicomService.Definition, DicomService.Update { + private DicomServiceInner innerObject; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ServiceManagedIdentityIdentity identity() { + return this.innerModel().identity(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DicomServiceAuthenticationConfiguration authenticationConfiguration() { + return this.innerModel().authenticationConfiguration(); + } + + public String serviceUrl() { + return this.innerModel().serviceUrl(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DicomServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String dicomServiceName; + + private DicomServicePatchResource updateDicomservicePatchResource; + + public DicomServiceImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public DicomService create() { + this.innerObject = + serviceManager + .serviceClient() + .getDicomServices() + .createOrUpdate(resourceGroupName, workspaceName, dicomServiceName, this.innerModel(), Context.NONE); + return this; + } + + public DicomService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDicomServices() + .createOrUpdate(resourceGroupName, workspaceName, dicomServiceName, this.innerModel(), context); + return this; + } + + DicomServiceImpl(String name, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = new DicomServiceInner(); + this.serviceManager = serviceManager; + this.dicomServiceName = name; + } + + public DicomServiceImpl update() { + this.updateDicomservicePatchResource = new DicomServicePatchResource(); + return this; + } + + public DicomService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDicomServices() + .update( + resourceGroupName, dicomServiceName, workspaceName, updateDicomservicePatchResource, Context.NONE); + return this; + } + + public DicomService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDicomServices() + .update(resourceGroupName, dicomServiceName, workspaceName, updateDicomservicePatchResource, context); + return this; + } + + DicomServiceImpl( + DicomServiceInner innerObject, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dicomServiceName = Utils.getValueFromIdByName(innerObject.id(), "dicomservices"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + } + + public DicomService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDicomServices() + .getWithResponse(resourceGroupName, workspaceName, dicomServiceName, Context.NONE) + .getValue(); + return this; + } + + public DicomService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDicomServices() + .getWithResponse(resourceGroupName, workspaceName, dicomServiceName, context) + .getValue(); + return this; + } + + public DicomServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DicomServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DicomServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateDicomservicePatchResource.withTags(tags); + return this; + } + } + + public DicomServiceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public DicomServiceImpl withIdentity(ServiceManagedIdentityIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateDicomservicePatchResource.withIdentity(identity); + return this; + } + } + + public DicomServiceImpl withAuthenticationConfiguration( + DicomServiceAuthenticationConfiguration authenticationConfiguration) { + this.innerModel().withAuthenticationConfiguration(authenticationConfiguration); + return this; + } + + public DicomServiceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServicesClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServicesClientImpl.java new file mode 100644 index 000000000000..881de50f2bb8 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServicesClientImpl.java @@ -0,0 +1,1481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.DicomServicesClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.DicomServiceInner; +import com.azure.resourcemanager.healthcareapis.models.DicomServiceCollection; +import com.azure.resourcemanager.healthcareapis.models.DicomServicePatchResource; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DicomServicesClient. */ +public final class DicomServicesClientImpl implements DicomServicesClient { + private final ClientLogger logger = new ClientLogger(DicomServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DicomServicesService service; + + /** The service client containing this operation class. */ + private final HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of DicomServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DicomServicesClientImpl(HealthcareApisManagementClientImpl client) { + this.service = + RestProxy.create(DicomServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HealthcareApisManagementClientDicomServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HealthcareApisManage") + private interface DicomServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/dicomservices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/dicomservices/{dicomServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @PathParam("dicomServiceName") String dicomServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/dicomservices/{dicomServiceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @PathParam("dicomServiceName") String dicomServiceName, + @BodyParam("application/json") DicomServiceInner dicomservice, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/dicomservices/{dicomServiceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("dicomServiceName") String dicomServiceName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") DicomServicePatchResource dicomservicePatchResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/dicomservices/{dicomServiceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dicomServiceName") String dicomServiceName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets the properties of the specified DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String dicomServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dicomServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dicomServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + dicomServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String dicomServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dicomServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dicomServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + dicomServiceName, + accept, + context); + } + + /** + * Gets the properties of the specified DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String dicomServiceName) { + return getWithResponseAsync(resourceGroupName, workspaceName, dicomServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DicomServiceInner get(String resourceGroupName, String workspaceName, String dicomServiceName) { + return getAsync(resourceGroupName, workspaceName, dicomServiceName).block(); + } + + /** + * Gets the properties of the specified DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String dicomServiceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, dicomServiceName, context).block(); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String dicomServiceName, DicomServiceInner dicomservice) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dicomServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dicomServiceName is required and cannot be null.")); + } + if (dicomservice == null) { + return Mono.error(new IllegalArgumentException("Parameter dicomservice is required and cannot be null.")); + } else { + dicomservice.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + dicomServiceName, + dicomservice, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String dicomServiceName, + DicomServiceInner dicomservice, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dicomServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dicomServiceName is required and cannot be null.")); + } + if (dicomservice == null) { + return Mono.error(new IllegalArgumentException("Parameter dicomservice is required and cannot be null.")); + } else { + dicomservice.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + dicomServiceName, + dicomservice, + accept, + context); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DicomServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String dicomServiceName, DicomServiceInner dicomservice) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dicomServiceName, dicomservice); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DicomServiceInner.class, + DicomServiceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DicomServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String dicomServiceName, + DicomServiceInner dicomservice, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dicomServiceName, dicomservice, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DicomServiceInner.class, DicomServiceInner.class, context); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DicomServiceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String dicomServiceName, DicomServiceInner dicomservice) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, dicomServiceName, dicomservice) + .getSyncPoller(); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DicomServiceInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String dicomServiceName, + DicomServiceInner dicomservice, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, dicomServiceName, dicomservice, context) + .getSyncPoller(); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String dicomServiceName, DicomServiceInner dicomservice) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, dicomServiceName, dicomservice) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String dicomServiceName, + DicomServiceInner dicomservice, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, dicomServiceName, dicomservice, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DicomServiceInner createOrUpdate( + String resourceGroupName, String workspaceName, String dicomServiceName, DicomServiceInner dicomservice) { + return createOrUpdateAsync(resourceGroupName, workspaceName, dicomServiceName, dicomservice).block(); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DicomServiceInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String dicomServiceName, + DicomServiceInner dicomservice, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, dicomServiceName, dicomservice, context).block(); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dicomServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dicomServiceName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dicomservicePatchResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dicomservicePatchResource is required and cannot be null.")); + } else { + dicomservicePatchResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + dicomServiceName, + workspaceName, + dicomservicePatchResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dicomServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dicomServiceName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dicomservicePatchResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dicomservicePatchResource is required and cannot be null.")); + } else { + dicomservicePatchResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + dicomServiceName, + workspaceName, + dicomservicePatchResource, + accept, + context); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DicomServiceInner> beginUpdateAsync( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DicomServiceInner.class, + DicomServiceInner.class, + this.client.getContext()); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DicomServiceInner> beginUpdateAsync( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DicomServiceInner.class, DicomServiceInner.class, context); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DicomServiceInner> beginUpdate( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource) { + return beginUpdateAsync(resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource) + .getSyncPoller(); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DicomServiceInner> beginUpdate( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource, + Context context) { + return beginUpdateAsync(resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource, context) + .getSyncPoller(); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource) { + return beginUpdateAsync(resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource, + Context context) { + return beginUpdateAsync(resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DicomServiceInner update( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource) { + return updateAsync(resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource).block(); + } + + /** + * Patch DICOM Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Dicom Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DicomServiceInner update( + String resourceGroupName, + String dicomServiceName, + String workspaceName, + DicomServicePatchResource dicomservicePatchResource, + Context context) { + return updateAsync(resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource, context) + .block(); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String dicomServiceName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dicomServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dicomServiceName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + dicomServiceName, + workspaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String dicomServiceName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dicomServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dicomServiceName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + dicomServiceName, + workspaceName, + accept, + context); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String dicomServiceName, String workspaceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, dicomServiceName, workspaceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String dicomServiceName, String workspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, dicomServiceName, workspaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String dicomServiceName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, dicomServiceName, workspaceName).getSyncPoller(); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String dicomServiceName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, dicomServiceName, workspaceName, context).getSyncPoller(); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dicomServiceName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, dicomServiceName, workspaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String dicomServiceName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, dicomServiceName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dicomServiceName, String workspaceName) { + deleteAsync(resourceGroupName, dicomServiceName, workspaceName).block(); + } + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dicomServiceName, String workspaceName, Context context) { + deleteAsync(resourceGroupName, dicomServiceName, workspaceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServicesImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServicesImpl.java new file mode 100644 index 000000000000..4d9eb3d3ebc7 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServicesImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.DicomServicesClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.DicomServiceInner; +import com.azure.resourcemanager.healthcareapis.models.DicomService; +import com.azure.resourcemanager.healthcareapis.models.DicomServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DicomServicesImpl implements DicomServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DicomServicesImpl.class); + + private final DicomServicesClient innerClient; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public DicomServicesImpl( + DicomServicesClient innerClient, + com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new DicomServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new DicomServiceImpl(inner1, this.manager())); + } + + public DicomService get(String resourceGroupName, String workspaceName, String dicomServiceName) { + DicomServiceInner inner = this.serviceClient().get(resourceGroupName, workspaceName, dicomServiceName); + if (inner != null) { + return new DicomServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String dicomServiceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, dicomServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DicomServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String dicomServiceName, String workspaceName) { + this.serviceClient().delete(resourceGroupName, dicomServiceName, workspaceName); + } + + public void delete(String resourceGroupName, String dicomServiceName, String workspaceName, Context context) { + this.serviceClient().delete(resourceGroupName, dicomServiceName, workspaceName, context); + } + + public DicomService getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String dicomServiceName = Utils.getValueFromIdByName(id, "dicomservices"); + if (dicomServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dicomservices'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, dicomServiceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String dicomServiceName = Utils.getValueFromIdByName(id, "dicomservices"); + if (dicomServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dicomservices'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, dicomServiceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dicomServiceName = Utils.getValueFromIdByName(id, "dicomservices"); + if (dicomServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dicomservices'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, dicomServiceName, workspaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dicomServiceName = Utils.getValueFromIdByName(id, "dicomservices"); + if (dicomServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dicomservices'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, dicomServiceName, workspaceName, context); + } + + private DicomServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + public DicomServiceImpl define(String name) { + return new DicomServiceImpl(name, this.manager()); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirDestinationsClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirDestinationsClientImpl.java new file mode 100644 index 000000000000..503431e4f5e0 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirDestinationsClientImpl.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.FhirDestinationsClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner; +import com.azure.resourcemanager.healthcareapis.models.IotFhirDestinationCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FhirDestinationsClient. */ +public final class FhirDestinationsClientImpl implements FhirDestinationsClient { + private final ClientLogger logger = new ClientLogger(FhirDestinationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FhirDestinationsService service; + + /** The service client containing this operation class. */ + private final HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of FhirDestinationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FhirDestinationsClientImpl(HealthcareApisManagementClientImpl client) { + this.service = + RestProxy.create(FhirDestinationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HealthcareApisManagementClientFhirDestinations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HealthcareApisManage") + private interface FhirDestinationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByIotConnector( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @PathParam("iotConnectorName") String iotConnectorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByIotConnectorNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByIotConnectorSinglePageAsync( + String resourceGroupName, String workspaceName, String iotConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByIotConnector( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByIotConnectorSinglePageAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByIotConnector( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByIotConnectorAsync( + String resourceGroupName, String workspaceName, String iotConnectorName) { + return new PagedFlux<>( + () -> listByIotConnectorSinglePageAsync(resourceGroupName, workspaceName, iotConnectorName), + nextLink -> listByIotConnectorNextSinglePageAsync(nextLink)); + } + + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByIotConnectorAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context) { + return new PagedFlux<>( + () -> listByIotConnectorSinglePageAsync(resourceGroupName, workspaceName, iotConnectorName, context), + nextLink -> listByIotConnectorNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByIotConnector( + String resourceGroupName, String workspaceName, String iotConnectorName) { + return new PagedIterable<>(listByIotConnectorAsync(resourceGroupName, workspaceName, iotConnectorName)); + } + + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByIotConnector( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context) { + return new PagedIterable<>( + listByIotConnectorAsync(resourceGroupName, workspaceName, iotConnectorName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByIotConnectorNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByIotConnectorNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByIotConnectorNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByIotConnectorNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirDestinationsImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirDestinationsImpl.java new file mode 100644 index 000000000000..eaf684b5d717 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirDestinationsImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.FhirDestinationsClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner; +import com.azure.resourcemanager.healthcareapis.models.FhirDestinations; +import com.azure.resourcemanager.healthcareapis.models.IotFhirDestination; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FhirDestinationsImpl implements FhirDestinations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirDestinationsImpl.class); + + private final FhirDestinationsClient innerClient; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public FhirDestinationsImpl( + FhirDestinationsClient innerClient, + com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByIotConnector( + String resourceGroupName, String workspaceName, String iotConnectorName) { + PagedIterable inner = + this.serviceClient().listByIotConnector(resourceGroupName, workspaceName, iotConnectorName); + return Utils.mapPage(inner, inner1 -> new IotFhirDestinationImpl(inner1, this.manager())); + } + + public PagedIterable listByIotConnector( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context) { + PagedIterable inner = + this.serviceClient().listByIotConnector(resourceGroupName, workspaceName, iotConnectorName, context); + return Utils.mapPage(inner, inner1 -> new IotFhirDestinationImpl(inner1, this.manager())); + } + + private FhirDestinationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServiceImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServiceImpl.java new file mode 100644 index 000000000000..83ba53d917af --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServiceImpl.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.FhirServiceInner; +import com.azure.resourcemanager.healthcareapis.models.FhirService; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAccessPolicyEntry; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAcrConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAuthenticationConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceCorsConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceExportConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceKind; +import com.azure.resourcemanager.healthcareapis.models.FhirServicePatchResource; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnection; +import com.azure.resourcemanager.healthcareapis.models.ProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.PublicNetworkAccess; +import com.azure.resourcemanager.healthcareapis.models.ResourceVersionPolicyConfiguration; +import com.azure.resourcemanager.healthcareapis.models.ServiceEventState; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class FhirServiceImpl implements FhirService, FhirService.Definition, FhirService.Update { + private FhirServiceInner innerObject; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public FhirServiceKind kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ServiceManagedIdentityIdentity identity() { + return this.innerModel().identity(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List accessPolicies() { + List inner = this.innerModel().accessPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public FhirServiceAcrConfiguration acrConfiguration() { + return this.innerModel().acrConfiguration(); + } + + public FhirServiceAuthenticationConfiguration authenticationConfiguration() { + return this.innerModel().authenticationConfiguration(); + } + + public FhirServiceCorsConfiguration corsConfiguration() { + return this.innerModel().corsConfiguration(); + } + + public FhirServiceExportConfiguration exportConfiguration() { + return this.innerModel().exportConfiguration(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ServiceEventState eventState() { + return this.innerModel().eventState(); + } + + public ResourceVersionPolicyConfiguration resourceVersionPolicyConfiguration() { + return this.innerModel().resourceVersionPolicyConfiguration(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public FhirServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String fhirServiceName; + + private FhirServicePatchResource updateFhirservicePatchResource; + + public FhirServiceImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public FhirService create() { + this.innerObject = + serviceManager + .serviceClient() + .getFhirServices() + .createOrUpdate(resourceGroupName, workspaceName, fhirServiceName, this.innerModel(), Context.NONE); + return this; + } + + public FhirService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFhirServices() + .createOrUpdate(resourceGroupName, workspaceName, fhirServiceName, this.innerModel(), context); + return this; + } + + FhirServiceImpl(String name, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = new FhirServiceInner(); + this.serviceManager = serviceManager; + this.fhirServiceName = name; + } + + public FhirServiceImpl update() { + this.updateFhirservicePatchResource = new FhirServicePatchResource(); + return this; + } + + public FhirService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFhirServices() + .update( + resourceGroupName, fhirServiceName, workspaceName, updateFhirservicePatchResource, Context.NONE); + return this; + } + + public FhirService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFhirServices() + .update(resourceGroupName, fhirServiceName, workspaceName, updateFhirservicePatchResource, context); + return this; + } + + FhirServiceImpl( + FhirServiceInner innerObject, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fhirServiceName = Utils.getValueFromIdByName(innerObject.id(), "fhirservices"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + } + + public FhirService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFhirServices() + .getWithResponse(resourceGroupName, workspaceName, fhirServiceName, Context.NONE) + .getValue(); + return this; + } + + public FhirService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFhirServices() + .getWithResponse(resourceGroupName, workspaceName, fhirServiceName, context) + .getValue(); + return this; + } + + public FhirServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FhirServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FhirServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateFhirservicePatchResource.withTags(tags); + return this; + } + } + + public FhirServiceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public FhirServiceImpl withKind(FhirServiceKind kind) { + this.innerModel().withKind(kind); + return this; + } + + public FhirServiceImpl withIdentity(ServiceManagedIdentityIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateFhirservicePatchResource.withIdentity(identity); + return this; + } + } + + public FhirServiceImpl withAccessPolicies(List accessPolicies) { + this.innerModel().withAccessPolicies(accessPolicies); + return this; + } + + public FhirServiceImpl withAcrConfiguration(FhirServiceAcrConfiguration acrConfiguration) { + this.innerModel().withAcrConfiguration(acrConfiguration); + return this; + } + + public FhirServiceImpl withAuthenticationConfiguration( + FhirServiceAuthenticationConfiguration authenticationConfiguration) { + this.innerModel().withAuthenticationConfiguration(authenticationConfiguration); + return this; + } + + public FhirServiceImpl withCorsConfiguration(FhirServiceCorsConfiguration corsConfiguration) { + this.innerModel().withCorsConfiguration(corsConfiguration); + return this; + } + + public FhirServiceImpl withExportConfiguration(FhirServiceExportConfiguration exportConfiguration) { + this.innerModel().withExportConfiguration(exportConfiguration); + return this; + } + + public FhirServiceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + public FhirServiceImpl withResourceVersionPolicyConfiguration( + ResourceVersionPolicyConfiguration resourceVersionPolicyConfiguration) { + this.innerModel().withResourceVersionPolicyConfiguration(resourceVersionPolicyConfiguration); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServicesClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServicesClientImpl.java new file mode 100644 index 000000000000..4638b757ba54 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServicesClientImpl.java @@ -0,0 +1,1473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.FhirServicesClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.FhirServiceInner; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceCollection; +import com.azure.resourcemanager.healthcareapis.models.FhirServicePatchResource; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FhirServicesClient. */ +public final class FhirServicesClientImpl implements FhirServicesClient { + private final ClientLogger logger = new ClientLogger(FhirServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FhirServicesService service; + + /** The service client containing this operation class. */ + private final HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of FhirServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FhirServicesClientImpl(HealthcareApisManagementClientImpl client) { + this.service = + RestProxy.create(FhirServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HealthcareApisManagementClientFhirServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HealthcareApisManage") + private interface FhirServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/fhirservices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/fhirservices/{fhirServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @PathParam("fhirServiceName") String fhirServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/fhirservices/{fhirServiceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @PathParam("fhirServiceName") String fhirServiceName, + @BodyParam("application/json") FhirServiceInner fhirservice, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/fhirservices/{fhirServiceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fhirServiceName") String fhirServiceName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") FhirServicePatchResource fhirservicePatchResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/fhirservices/{fhirServiceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fhirServiceName") String fhirServiceName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets the properties of the specified FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String fhirServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (fhirServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + fhirServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String fhirServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (fhirServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + fhirServiceName, + accept, + context); + } + + /** + * Gets the properties of the specified FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String fhirServiceName) { + return getWithResponseAsync(resourceGroupName, workspaceName, fhirServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FhirServiceInner get(String resourceGroupName, String workspaceName, String fhirServiceName) { + return getAsync(resourceGroupName, workspaceName, fhirServiceName).block(); + } + + /** + * Gets the properties of the specified FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String fhirServiceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, fhirServiceName, context).block(); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String fhirServiceName, FhirServiceInner fhirservice) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (fhirServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirServiceName is required and cannot be null.")); + } + if (fhirservice == null) { + return Mono.error(new IllegalArgumentException("Parameter fhirservice is required and cannot be null.")); + } else { + fhirservice.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + fhirServiceName, + fhirservice, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String fhirServiceName, + FhirServiceInner fhirservice, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (fhirServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirServiceName is required and cannot be null.")); + } + if (fhirservice == null) { + return Mono.error(new IllegalArgumentException("Parameter fhirservice is required and cannot be null.")); + } else { + fhirservice.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + fhirServiceName, + fhirservice, + accept, + context); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FhirServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String fhirServiceName, FhirServiceInner fhirservice) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, fhirServiceName, fhirservice); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FhirServiceInner.class, + FhirServiceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FhirServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String fhirServiceName, + FhirServiceInner fhirservice, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, fhirServiceName, fhirservice, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FhirServiceInner.class, FhirServiceInner.class, context); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FhirServiceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String fhirServiceName, FhirServiceInner fhirservice) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, fhirServiceName, fhirservice).getSyncPoller(); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FhirServiceInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String fhirServiceName, + FhirServiceInner fhirservice, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, fhirServiceName, fhirservice, context) + .getSyncPoller(); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String fhirServiceName, FhirServiceInner fhirservice) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, fhirServiceName, fhirservice) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String fhirServiceName, + FhirServiceInner fhirservice, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, fhirServiceName, fhirservice, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FhirServiceInner createOrUpdate( + String resourceGroupName, String workspaceName, String fhirServiceName, FhirServiceInner fhirservice) { + return createOrUpdateAsync(resourceGroupName, workspaceName, fhirServiceName, fhirservice).block(); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FhirServiceInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String fhirServiceName, + FhirServiceInner fhirservice, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, fhirServiceName, fhirservice, context).block(); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fhirServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirServiceName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (fhirservicePatchResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter fhirservicePatchResource is required and cannot be null.")); + } else { + fhirservicePatchResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fhirServiceName, + workspaceName, + fhirservicePatchResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fhirServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirServiceName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (fhirservicePatchResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter fhirservicePatchResource is required and cannot be null.")); + } else { + fhirservicePatchResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fhirServiceName, + workspaceName, + fhirservicePatchResource, + accept, + context); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FhirServiceInner> beginUpdateAsync( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FhirServiceInner.class, + FhirServiceInner.class, + this.client.getContext()); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FhirServiceInner> beginUpdateAsync( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FhirServiceInner.class, FhirServiceInner.class, context); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FhirServiceInner> beginUpdate( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource) { + return beginUpdateAsync(resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource) + .getSyncPoller(); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FhirServiceInner> beginUpdate( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource, + Context context) { + return beginUpdateAsync(resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource, context) + .getSyncPoller(); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource) { + return beginUpdateAsync(resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource, + Context context) { + return beginUpdateAsync(resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FhirServiceInner update( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource) { + return updateAsync(resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource).block(); + } + + /** + * Patch FHIR Service details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of Fhir Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FhirServiceInner update( + String resourceGroupName, + String fhirServiceName, + String workspaceName, + FhirServicePatchResource fhirservicePatchResource, + Context context) { + return updateAsync(resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource, context) + .block(); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String fhirServiceName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fhirServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirServiceName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + fhirServiceName, + workspaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String fhirServiceName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fhirServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirServiceName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + fhirServiceName, + workspaceName, + accept, + context); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String fhirServiceName, String workspaceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, fhirServiceName, workspaceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String fhirServiceName, String workspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, fhirServiceName, workspaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String fhirServiceName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, fhirServiceName, workspaceName).getSyncPoller(); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String fhirServiceName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, fhirServiceName, workspaceName, context).getSyncPoller(); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String fhirServiceName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, fhirServiceName, workspaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String fhirServiceName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, fhirServiceName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String fhirServiceName, String workspaceName) { + deleteAsync(resourceGroupName, fhirServiceName, workspaceName).block(); + } + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String fhirServiceName, String workspaceName, Context context) { + deleteAsync(resourceGroupName, fhirServiceName, workspaceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServicesImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServicesImpl.java new file mode 100644 index 000000000000..ffc2d908f2d7 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServicesImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.FhirServicesClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.FhirServiceInner; +import com.azure.resourcemanager.healthcareapis.models.FhirService; +import com.azure.resourcemanager.healthcareapis.models.FhirServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FhirServicesImpl implements FhirServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServicesImpl.class); + + private final FhirServicesClient innerClient; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public FhirServicesImpl( + FhirServicesClient innerClient, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new FhirServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new FhirServiceImpl(inner1, this.manager())); + } + + public FhirService get(String resourceGroupName, String workspaceName, String fhirServiceName) { + FhirServiceInner inner = this.serviceClient().get(resourceGroupName, workspaceName, fhirServiceName); + if (inner != null) { + return new FhirServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String fhirServiceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, fhirServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FhirServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String fhirServiceName, String workspaceName) { + this.serviceClient().delete(resourceGroupName, fhirServiceName, workspaceName); + } + + public void delete(String resourceGroupName, String fhirServiceName, String workspaceName, Context context) { + this.serviceClient().delete(resourceGroupName, fhirServiceName, workspaceName, context); + } + + public FhirService getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String fhirServiceName = Utils.getValueFromIdByName(id, "fhirservices"); + if (fhirServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fhirservices'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, fhirServiceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String fhirServiceName = Utils.getValueFromIdByName(id, "fhirservices"); + if (fhirServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fhirservices'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, fhirServiceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fhirServiceName = Utils.getValueFromIdByName(id, "fhirservices"); + if (fhirServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fhirservices'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, fhirServiceName, workspaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fhirServiceName = Utils.getValueFromIdByName(id, "fhirservices"); + if (fhirServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fhirservices'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, fhirServiceName, workspaceName, context); + } + + private FhirServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + public FhirServiceImpl define(String name) { + return new FhirServiceImpl(name, this.manager()); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/HealthcareApisManagementClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/HealthcareApisManagementClientImpl.java index fb4a7412bc0c..4f90c062a4b4 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/HealthcareApisManagementClientImpl.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/HealthcareApisManagementClientImpl.java @@ -21,12 +21,20 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.healthcareapis.fluent.DicomServicesClient; +import com.azure.resourcemanager.healthcareapis.fluent.FhirDestinationsClient; +import com.azure.resourcemanager.healthcareapis.fluent.FhirServicesClient; import com.azure.resourcemanager.healthcareapis.fluent.HealthcareApisManagementClient; +import com.azure.resourcemanager.healthcareapis.fluent.IotConnectorFhirDestinationsClient; +import com.azure.resourcemanager.healthcareapis.fluent.IotConnectorsClient; import com.azure.resourcemanager.healthcareapis.fluent.OperationResultsClient; import com.azure.resourcemanager.healthcareapis.fluent.OperationsClient; import com.azure.resourcemanager.healthcareapis.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.healthcareapis.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.healthcareapis.fluent.ServicesClient; +import com.azure.resourcemanager.healthcareapis.fluent.WorkspacePrivateEndpointConnectionsClient; +import com.azure.resourcemanager.healthcareapis.fluent.WorkspacePrivateLinkResourcesClient; +import com.azure.resourcemanager.healthcareapis.fluent.WorkspacesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -126,30 +134,6 @@ public ServicesClient getServices() { return this.services; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The OperationResultsClient object to access its operations. */ - private final OperationResultsClient operationResults; - - /** - * Gets the OperationResultsClient object to access its operations. - * - * @return the OperationResultsClient object. - */ - public OperationResultsClient getOperationResults() { - return this.operationResults; - } - /** The PrivateEndpointConnectionsClient object to access its operations. */ private final PrivateEndpointConnectionsClient privateEndpointConnections; @@ -174,6 +158,126 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } + /** The WorkspacesClient object to access its operations. */ + private final WorkspacesClient workspaces; + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + public WorkspacesClient getWorkspaces() { + return this.workspaces; + } + + /** The DicomServicesClient object to access its operations. */ + private final DicomServicesClient dicomServices; + + /** + * Gets the DicomServicesClient object to access its operations. + * + * @return the DicomServicesClient object. + */ + public DicomServicesClient getDicomServices() { + return this.dicomServices; + } + + /** The IotConnectorsClient object to access its operations. */ + private final IotConnectorsClient iotConnectors; + + /** + * Gets the IotConnectorsClient object to access its operations. + * + * @return the IotConnectorsClient object. + */ + public IotConnectorsClient getIotConnectors() { + return this.iotConnectors; + } + + /** The FhirDestinationsClient object to access its operations. */ + private final FhirDestinationsClient fhirDestinations; + + /** + * Gets the FhirDestinationsClient object to access its operations. + * + * @return the FhirDestinationsClient object. + */ + public FhirDestinationsClient getFhirDestinations() { + return this.fhirDestinations; + } + + /** The IotConnectorFhirDestinationsClient object to access its operations. */ + private final IotConnectorFhirDestinationsClient iotConnectorFhirDestinations; + + /** + * Gets the IotConnectorFhirDestinationsClient object to access its operations. + * + * @return the IotConnectorFhirDestinationsClient object. + */ + public IotConnectorFhirDestinationsClient getIotConnectorFhirDestinations() { + return this.iotConnectorFhirDestinations; + } + + /** The FhirServicesClient object to access its operations. */ + private final FhirServicesClient fhirServices; + + /** + * Gets the FhirServicesClient object to access its operations. + * + * @return the FhirServicesClient object. + */ + public FhirServicesClient getFhirServices() { + return this.fhirServices; + } + + /** The WorkspacePrivateEndpointConnectionsClient object to access its operations. */ + private final WorkspacePrivateEndpointConnectionsClient workspacePrivateEndpointConnections; + + /** + * Gets the WorkspacePrivateEndpointConnectionsClient object to access its operations. + * + * @return the WorkspacePrivateEndpointConnectionsClient object. + */ + public WorkspacePrivateEndpointConnectionsClient getWorkspacePrivateEndpointConnections() { + return this.workspacePrivateEndpointConnections; + } + + /** The WorkspacePrivateLinkResourcesClient object to access its operations. */ + private final WorkspacePrivateLinkResourcesClient workspacePrivateLinkResources; + + /** + * Gets the WorkspacePrivateLinkResourcesClient object to access its operations. + * + * @return the WorkspacePrivateLinkResourcesClient object. + */ + public WorkspacePrivateLinkResourcesClient getWorkspacePrivateLinkResources() { + return this.workspacePrivateLinkResources; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The OperationResultsClient object to access its operations. */ + private final OperationResultsClient operationResults; + + /** + * Gets the OperationResultsClient object to access its operations. + * + * @return the OperationResultsClient object. + */ + public OperationResultsClient getOperationResults() { + return this.operationResults; + } + /** * Initializes an instance of HealthcareApisManagementClient client. * @@ -196,12 +300,20 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-01-11"; + this.apiVersion = "2021-11-01"; this.services = new ServicesClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.operationResults = new OperationResultsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.workspaces = new WorkspacesClientImpl(this); + this.dicomServices = new DicomServicesClientImpl(this); + this.iotConnectors = new IotConnectorsClientImpl(this); + this.fhirDestinations = new FhirDestinationsClientImpl(this); + this.iotConnectorFhirDestinations = new IotConnectorFhirDestinationsClientImpl(this); + this.fhirServices = new FhirServicesClientImpl(this); + this.workspacePrivateEndpointConnections = new WorkspacePrivateEndpointConnectionsClientImpl(this); + this.workspacePrivateLinkResources = new WorkspacePrivateLinkResourcesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.operationResults = new OperationResultsClientImpl(this); } /** diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorFhirDestinationsClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorFhirDestinationsClientImpl.java new file mode 100644 index 000000000000..84280c4c12c6 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorFhirDestinationsClientImpl.java @@ -0,0 +1,983 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.IotConnectorFhirDestinationsClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IotConnectorFhirDestinationsClient. */ +public final class IotConnectorFhirDestinationsClientImpl implements IotConnectorFhirDestinationsClient { + private final ClientLogger logger = new ClientLogger(IotConnectorFhirDestinationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IotConnectorFhirDestinationsService service; + + /** The service client containing this operation class. */ + private final HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of IotConnectorFhirDestinationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IotConnectorFhirDestinationsClientImpl(HealthcareApisManagementClientImpl client) { + this.service = + RestProxy + .create( + IotConnectorFhirDestinationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HealthcareApisManagementClientIotConnectorFhirDestinations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HealthcareApisManage") + private interface IotConnectorFhirDestinationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @PathParam("iotConnectorName") String iotConnectorName, + @PathParam("fhirDestinationName") String fhirDestinationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @PathParam("iotConnectorName") String iotConnectorName, + @PathParam("fhirDestinationName") String fhirDestinationName, + @BodyParam("application/json") IotFhirDestinationInner iotFhirDestination, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("iotConnectorName") String iotConnectorName, + @PathParam("fhirDestinationName") String fhirDestinationName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (fhirDestinationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirDestinationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + fhirDestinationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (fhirDestinationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirDestinationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + fhirDestinationName, + accept, + context); + } + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + return getWithResponseAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IotFhirDestinationInner get( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + return getAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName).block(); + } + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context) + .block(); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector FHIR destination definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (fhirDestinationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirDestinationName is required and cannot be null.")); + } + if (iotFhirDestination == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotFhirDestination is required and cannot be null.")); + } else { + iotFhirDestination.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + fhirDestinationName, + iotFhirDestination, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector FHIR destination definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (fhirDestinationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirDestinationName is required and cannot be null.")); + } + if (iotFhirDestination == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotFhirDestination is required and cannot be null.")); + } else { + iotFhirDestination.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + fhirDestinationName, + iotFhirDestination, + accept, + context); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IotFhirDestinationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IotFhirDestinationInner.class, + IotFhirDestinationInner.class, + this.client.getContext()); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IotFhirDestinationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IotFhirDestinationInner.class, + IotFhirDestinationInner.class, + context); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IotFhirDestinationInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination) + .getSyncPoller(); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IotFhirDestinationInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination, context) + .getSyncPoller(); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector FHIR destination definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector FHIR destination definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IotFhirDestinationInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination) { + return createOrUpdateAsync( + resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination) + .block(); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector FHIR destination definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IotFhirDestinationInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + IotFhirDestinationInner iotFhirDestination, + Context context) { + return createOrUpdateAsync( + resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination, context) + .block(); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (fhirDestinationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirDestinationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + iotConnectorName, + fhirDestinationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (fhirDestinationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fhirDestinationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + iotConnectorName, + fhirDestinationName, + accept, + context); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + return beginDeleteAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName) + .getSyncPoller(); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context) + .getSyncPoller(); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + return beginDeleteAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + deleteAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName).block(); + } + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context) { + deleteAsync(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context).block(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorFhirDestinationsImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorFhirDestinationsImpl.java new file mode 100644 index 000000000000..1282b737fe7a --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorFhirDestinationsImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.IotConnectorFhirDestinationsClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner; +import com.azure.resourcemanager.healthcareapis.models.IotConnectorFhirDestinations; +import com.azure.resourcemanager.healthcareapis.models.IotFhirDestination; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IotConnectorFhirDestinationsImpl implements IotConnectorFhirDestinations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotConnectorFhirDestinationsImpl.class); + + private final IotConnectorFhirDestinationsClient innerClient; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public IotConnectorFhirDestinationsImpl( + IotConnectorFhirDestinationsClient innerClient, + com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public IotFhirDestination get( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + IotFhirDestinationInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName); + if (inner != null) { + return new IotFhirDestinationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IotFhirDestinationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName) { + this.serviceClient().delete(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName); + } + + public void delete( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context); + } + + public IotFhirDestination getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String iotConnectorName = Utils.getValueFromIdByName(id, "iotconnectors"); + if (iotConnectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotconnectors'.", id))); + } + String fhirDestinationName = Utils.getValueFromIdByName(id, "fhirdestinations"); + if (fhirDestinationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'fhirdestinations'.", id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String iotConnectorName = Utils.getValueFromIdByName(id, "iotconnectors"); + if (iotConnectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotconnectors'.", id))); + } + String fhirDestinationName = Utils.getValueFromIdByName(id, "fhirdestinations"); + if (fhirDestinationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'fhirdestinations'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String iotConnectorName = Utils.getValueFromIdByName(id, "iotconnectors"); + if (iotConnectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotconnectors'.", id))); + } + String fhirDestinationName = Utils.getValueFromIdByName(id, "fhirdestinations"); + if (fhirDestinationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'fhirdestinations'.", id))); + } + this.delete(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String iotConnectorName = Utils.getValueFromIdByName(id, "iotconnectors"); + if (iotConnectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotconnectors'.", id))); + } + String fhirDestinationName = Utils.getValueFromIdByName(id, "fhirdestinations"); + if (fhirDestinationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'fhirdestinations'.", id))); + } + this.delete(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context); + } + + private IotConnectorFhirDestinationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + public IotFhirDestinationImpl define(String name) { + return new IotFhirDestinationImpl(name, this.manager()); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorImpl.java new file mode 100644 index 000000000000..0009a79a9b13 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotConnectorInner; +import com.azure.resourcemanager.healthcareapis.models.IotConnector; +import com.azure.resourcemanager.healthcareapis.models.IotConnectorPatchResource; +import com.azure.resourcemanager.healthcareapis.models.IotEventHubIngestionEndpointConfiguration; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; +import com.azure.resourcemanager.healthcareapis.models.ProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import java.util.Collections; +import java.util.Map; + +public final class IotConnectorImpl implements IotConnector, IotConnector.Definition, IotConnector.Update { + private IotConnectorInner innerObject; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ServiceManagedIdentityIdentity identity() { + return this.innerModel().identity(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration() { + return this.innerModel().ingestionEndpointConfiguration(); + } + + public IotMappingProperties deviceMapping() { + return this.innerModel().deviceMapping(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public IotConnectorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String iotConnectorName; + + private IotConnectorPatchResource updateIotConnectorPatchResource; + + public IotConnectorImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public IotConnector create() { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectors() + .createOrUpdate(resourceGroupName, workspaceName, iotConnectorName, this.innerModel(), Context.NONE); + return this; + } + + public IotConnector create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectors() + .createOrUpdate(resourceGroupName, workspaceName, iotConnectorName, this.innerModel(), context); + return this; + } + + IotConnectorImpl(String name, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = new IotConnectorInner(); + this.serviceManager = serviceManager; + this.iotConnectorName = name; + } + + public IotConnectorImpl update() { + this.updateIotConnectorPatchResource = new IotConnectorPatchResource(); + return this; + } + + public IotConnector apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectors() + .update( + resourceGroupName, iotConnectorName, workspaceName, updateIotConnectorPatchResource, Context.NONE); + return this; + } + + public IotConnector apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectors() + .update(resourceGroupName, iotConnectorName, workspaceName, updateIotConnectorPatchResource, context); + return this; + } + + IotConnectorImpl( + IotConnectorInner innerObject, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.iotConnectorName = Utils.getValueFromIdByName(innerObject.id(), "iotconnectors"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + } + + public IotConnector refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectors() + .getWithResponse(resourceGroupName, workspaceName, iotConnectorName, Context.NONE) + .getValue(); + return this; + } + + public IotConnector refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectors() + .getWithResponse(resourceGroupName, workspaceName, iotConnectorName, context) + .getValue(); + return this; + } + + public IotConnectorImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IotConnectorImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IotConnectorImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateIotConnectorPatchResource.withTags(tags); + return this; + } + } + + public IotConnectorImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public IotConnectorImpl withIdentity(ServiceManagedIdentityIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateIotConnectorPatchResource.withIdentity(identity); + return this; + } + } + + public IotConnectorImpl withIngestionEndpointConfiguration( + IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration) { + this.innerModel().withIngestionEndpointConfiguration(ingestionEndpointConfiguration); + return this; + } + + public IotConnectorImpl withDeviceMapping(IotMappingProperties deviceMapping) { + this.innerModel().withDeviceMapping(deviceMapping); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorsClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorsClientImpl.java new file mode 100644 index 000000000000..b5d697e2aeb6 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorsClientImpl.java @@ -0,0 +1,1477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.IotConnectorsClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotConnectorInner; +import com.azure.resourcemanager.healthcareapis.models.IotConnectorCollection; +import com.azure.resourcemanager.healthcareapis.models.IotConnectorPatchResource; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IotConnectorsClient. */ +public final class IotConnectorsClientImpl implements IotConnectorsClient { + private final ClientLogger logger = new ClientLogger(IotConnectorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IotConnectorsService service; + + /** The service client containing this operation class. */ + private final HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of IotConnectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IotConnectorsClientImpl(HealthcareApisManagementClientImpl client) { + this.service = + RestProxy.create(IotConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HealthcareApisManagementClientIotConnectors to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HealthcareApisManage") + private interface IotConnectorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/iotconnectors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @PathParam("iotConnectorName") String iotConnectorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @PathParam("iotConnectorName") String iotConnectorName, + @BodyParam("application/json") IotConnectorInner iotConnector, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("iotConnectorName") String iotConnectorName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") IotConnectorPatchResource iotConnectorPatchResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("iotConnectorName") String iotConnectorName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets the properties of the specified IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String iotConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + accept, + context); + } + + /** + * Gets the properties of the specified IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String iotConnectorName) { + return getWithResponseAsync(resourceGroupName, workspaceName, iotConnectorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IotConnectorInner get(String resourceGroupName, String workspaceName, String iotConnectorName) { + return getAsync(resourceGroupName, workspaceName, iotConnectorName).block(); + } + + /** + * Gets the properties of the specified IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, iotConnectorName, context).block(); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, IotConnectorInner iotConnector) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (iotConnector == null) { + return Mono.error(new IllegalArgumentException("Parameter iotConnector is required and cannot be null.")); + } else { + iotConnector.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + iotConnector, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + IotConnectorInner iotConnector, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (iotConnector == null) { + return Mono.error(new IllegalArgumentException("Parameter iotConnector is required and cannot be null.")); + } else { + iotConnector.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + iotConnectorName, + iotConnector, + accept, + context); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IotConnectorInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, IotConnectorInner iotConnector) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, iotConnectorName, iotConnector); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IotConnectorInner.class, + IotConnectorInner.class, + this.client.getContext()); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IotConnectorInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + IotConnectorInner iotConnector, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, iotConnectorName, iotConnector, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IotConnectorInner.class, IotConnectorInner.class, context); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IotConnectorInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String iotConnectorName, IotConnectorInner iotConnector) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, iotConnectorName, iotConnector) + .getSyncPoller(); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IotConnectorInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + IotConnectorInner iotConnector, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, iotConnectorName, iotConnector, context) + .getSyncPoller(); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String iotConnectorName, IotConnectorInner iotConnector) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, iotConnectorName, iotConnector) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + IotConnectorInner iotConnector, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, iotConnectorName, iotConnector, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IotConnectorInner createOrUpdate( + String resourceGroupName, String workspaceName, String iotConnectorName, IotConnectorInner iotConnector) { + return createOrUpdateAsync(resourceGroupName, workspaceName, iotConnectorName, iotConnector).block(); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IotConnectorInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + IotConnectorInner iotConnector, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, iotConnectorName, iotConnector, context).block(); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorPatchResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter iotConnectorPatchResource is required and cannot be null.")); + } else { + iotConnectorPatchResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + iotConnectorName, + workspaceName, + iotConnectorPatchResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (iotConnectorPatchResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter iotConnectorPatchResource is required and cannot be null.")); + } else { + iotConnectorPatchResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + iotConnectorName, + workspaceName, + iotConnectorPatchResource, + accept, + context); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IotConnectorInner> beginUpdateAsync( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IotConnectorInner.class, + IotConnectorInner.class, + this.client.getContext()); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IotConnectorInner> beginUpdateAsync( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IotConnectorInner.class, IotConnectorInner.class, context); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IotConnectorInner> beginUpdate( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource) { + return beginUpdateAsync(resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource) + .getSyncPoller(); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IotConnectorInner> beginUpdate( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource, + Context context) { + return beginUpdateAsync(resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource, context) + .getSyncPoller(); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource) { + return beginUpdateAsync(resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource, + Context context) { + return beginUpdateAsync(resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IotConnectorInner update( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource) { + return updateAsync(resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource).block(); + } + + /** + * Patch an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ioT Connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IotConnectorInner update( + String resourceGroupName, + String iotConnectorName, + String workspaceName, + IotConnectorPatchResource iotConnectorPatchResource, + Context context) { + return updateAsync(resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource, context) + .block(); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String iotConnectorName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + iotConnectorName, + workspaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String iotConnectorName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (iotConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iotConnectorName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + iotConnectorName, + workspaceName, + accept, + context); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String iotConnectorName, String workspaceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, iotConnectorName, workspaceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String iotConnectorName, String workspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, iotConnectorName, workspaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String iotConnectorName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, iotConnectorName, workspaceName).getSyncPoller(); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String iotConnectorName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, iotConnectorName, workspaceName, context).getSyncPoller(); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String iotConnectorName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, iotConnectorName, workspaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String iotConnectorName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, iotConnectorName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String iotConnectorName, String workspaceName) { + deleteAsync(resourceGroupName, iotConnectorName, workspaceName).block(); + } + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String iotConnectorName, String workspaceName, Context context) { + deleteAsync(resourceGroupName, iotConnectorName, workspaceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorsImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorsImpl.java new file mode 100644 index 000000000000..b33395c9112c --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorsImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.IotConnectorsClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotConnectorInner; +import com.azure.resourcemanager.healthcareapis.models.IotConnector; +import com.azure.resourcemanager.healthcareapis.models.IotConnectors; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IotConnectorsImpl implements IotConnectors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotConnectorsImpl.class); + + private final IotConnectorsClient innerClient; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public IotConnectorsImpl( + IotConnectorsClient innerClient, + com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new IotConnectorImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new IotConnectorImpl(inner1, this.manager())); + } + + public IotConnector get(String resourceGroupName, String workspaceName, String iotConnectorName) { + IotConnectorInner inner = this.serviceClient().get(resourceGroupName, workspaceName, iotConnectorName); + if (inner != null) { + return new IotConnectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, iotConnectorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IotConnectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String iotConnectorName, String workspaceName) { + this.serviceClient().delete(resourceGroupName, iotConnectorName, workspaceName); + } + + public void delete(String resourceGroupName, String iotConnectorName, String workspaceName, Context context) { + this.serviceClient().delete(resourceGroupName, iotConnectorName, workspaceName, context); + } + + public IotConnector getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String iotConnectorName = Utils.getValueFromIdByName(id, "iotconnectors"); + if (iotConnectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotconnectors'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, iotConnectorName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String iotConnectorName = Utils.getValueFromIdByName(id, "iotconnectors"); + if (iotConnectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotconnectors'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, iotConnectorName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String iotConnectorName = Utils.getValueFromIdByName(id, "iotconnectors"); + if (iotConnectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotconnectors'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, iotConnectorName, workspaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String iotConnectorName = Utils.getValueFromIdByName(id, "iotconnectors"); + if (iotConnectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotconnectors'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, iotConnectorName, workspaceName, context); + } + + private IotConnectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + public IotConnectorImpl define(String name) { + return new IotConnectorImpl(name, this.manager()); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotFhirDestinationImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotFhirDestinationImpl.java new file mode 100644 index 000000000000..d9de5b5c4bae --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotFhirDestinationImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner; +import com.azure.resourcemanager.healthcareapis.models.IotFhirDestination; +import com.azure.resourcemanager.healthcareapis.models.IotIdentityResolutionType; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; + +public final class IotFhirDestinationImpl + implements IotFhirDestination, IotFhirDestination.Definition, IotFhirDestination.Update { + private IotFhirDestinationInner innerObject; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public IotIdentityResolutionType resourceIdentityResolutionType() { + return this.innerModel().resourceIdentityResolutionType(); + } + + public String fhirServiceResourceId() { + return this.innerModel().fhirServiceResourceId(); + } + + public IotMappingProperties fhirMapping() { + return this.innerModel().fhirMapping(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public IotFhirDestinationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String iotConnectorName; + + private String fhirDestinationName; + + public IotFhirDestinationImpl withExistingIotconnector( + String resourceGroupName, String workspaceName, String iotConnectorName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.iotConnectorName = iotConnectorName; + return this; + } + + public IotFhirDestination create() { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectorFhirDestinations() + .createOrUpdate( + resourceGroupName, + workspaceName, + iotConnectorName, + fhirDestinationName, + this.innerModel(), + Context.NONE); + return this; + } + + public IotFhirDestination create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectorFhirDestinations() + .createOrUpdate( + resourceGroupName, + workspaceName, + iotConnectorName, + fhirDestinationName, + this.innerModel(), + context); + return this; + } + + IotFhirDestinationImpl(String name, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = new IotFhirDestinationInner(); + this.serviceManager = serviceManager; + this.fhirDestinationName = name; + } + + public IotFhirDestinationImpl update() { + return this; + } + + public IotFhirDestination apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectorFhirDestinations() + .createOrUpdate( + resourceGroupName, + workspaceName, + iotConnectorName, + fhirDestinationName, + this.innerModel(), + Context.NONE); + return this; + } + + public IotFhirDestination apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectorFhirDestinations() + .createOrUpdate( + resourceGroupName, + workspaceName, + iotConnectorName, + fhirDestinationName, + this.innerModel(), + context); + return this; + } + + IotFhirDestinationImpl( + IotFhirDestinationInner innerObject, + com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.iotConnectorName = Utils.getValueFromIdByName(innerObject.id(), "iotconnectors"); + this.fhirDestinationName = Utils.getValueFromIdByName(innerObject.id(), "fhirdestinations"); + } + + public IotFhirDestination refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectorFhirDestinations() + .getWithResponse(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, Context.NONE) + .getValue(); + return this; + } + + public IotFhirDestination refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIotConnectorFhirDestinations() + .getWithResponse(resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, context) + .getValue(); + return this; + } + + public IotFhirDestinationImpl withResourceIdentityResolutionType( + IotIdentityResolutionType resourceIdentityResolutionType) { + this.innerModel().withResourceIdentityResolutionType(resourceIdentityResolutionType); + return this; + } + + public IotFhirDestinationImpl withFhirServiceResourceId(String fhirServiceResourceId) { + this.innerModel().withFhirServiceResourceId(fhirServiceResourceId); + return this; + } + + public IotFhirDestinationImpl withFhirMapping(IotMappingProperties fhirMapping) { + this.innerModel().withFhirMapping(fhirMapping); + return this; + } + + public IotFhirDestinationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IotFhirDestinationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IotFhirDestinationImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationDetailImpl.java similarity index 57% rename from sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationImpl.java rename to sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationDetailImpl.java index ecb3ae9369f7..78f04d5741e2 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationImpl.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationDetailImpl.java @@ -4,17 +4,20 @@ package com.azure.resourcemanager.healthcareapis.implementation; -import com.azure.resourcemanager.healthcareapis.fluent.models.OperationInner; -import com.azure.resourcemanager.healthcareapis.models.Operation; +import com.azure.resourcemanager.healthcareapis.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.healthcareapis.models.ActionType; +import com.azure.resourcemanager.healthcareapis.models.OperationDetail; import com.azure.resourcemanager.healthcareapis.models.OperationDisplay; +import com.azure.resourcemanager.healthcareapis.models.OperationProperties; -public final class OperationImpl implements Operation { - private OperationInner innerObject; +public final class OperationDetailImpl implements OperationDetail { + private OperationDetailInner innerObject; private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; - OperationImpl( - OperationInner innerObject, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + OperationDetailImpl( + OperationDetailInner innerObject, + com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -23,15 +26,27 @@ public String name() { return this.innerModel().name(); } - public String origin() { - return this.innerModel().origin(); + public Boolean isDataAction() { + return this.innerModel().isDataAction(); } public OperationDisplay display() { return this.innerModel().display(); } - public OperationInner innerModel() { + public String origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationProperties properties() { + return this.innerModel().properties(); + } + + public OperationDetailInner innerModel() { return this.innerObject; } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationResultsClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationResultsClientImpl.java index 928c034e4158..12e61d5a455d 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationResultsClientImpl.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationResultsClientImpl.java @@ -78,7 +78,8 @@ Mono> get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. + * @return the operation result for a long running operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -127,7 +128,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. + * @return the operation result for a long running operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -172,7 +174,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. + * @return the operation result for a long running operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String locationName, String operationResultId) { @@ -211,7 +213,7 @@ public OperationResultsDescriptionInner get(String locationName, String operatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. + * @return the operation result for a long running operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationResultsDescriptionImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationResultsDescriptionImpl.java index 79cfee1c250c..5fc4499ae158 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationResultsDescriptionImpl.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationResultsDescriptionImpl.java @@ -36,6 +36,10 @@ public String startTime() { return this.innerModel().startTime(); } + public String endTime() { + return this.innerModel().endTime(); + } + public Object properties() { return this.innerModel().properties(); } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationsClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationsClientImpl.java index e8a4fb33de19..591cc7f5c4d3 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationsClientImpl.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationsClientImpl.java @@ -27,8 +27,8 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.healthcareapis.fluent.OperationsClient; -import com.azure.resourcemanager.healthcareapis.fluent.models.OperationInner; -import com.azure.resourcemanager.healthcareapis.models.OperationListResult; +import com.azure.resourcemanager.healthcareapis.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.healthcareapis.models.ListOperations; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ @@ -63,7 +63,7 @@ private interface OperationsService { @Get("/providers/Microsoft.HealthcareApis/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -73,7 +73,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -81,14 +81,15 @@ Mono> listNext( } /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -99,7 +100,7 @@ private Mono> listSinglePageAsync() { return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -112,16 +113,17 @@ private Mono> listSinglePageAsync() { } /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -144,55 +146,55 @@ private Mono> listSinglePageAsync(Context context) } /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>( () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } @@ -203,10 +205,11 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -219,7 +222,7 @@ private Mono> listNextSinglePageAsync(String nextL final String accept = "application/json"; return FluxUtil .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -239,10 +242,11 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationsImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationsImpl.java index 7ba00ce85913..aa1609d90b74 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationsImpl.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/OperationsImpl.java @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.healthcareapis.fluent.OperationsClient; -import com.azure.resourcemanager.healthcareapis.fluent.models.OperationInner; -import com.azure.resourcemanager.healthcareapis.models.Operation; +import com.azure.resourcemanager.healthcareapis.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.healthcareapis.models.OperationDetail; import com.azure.resourcemanager.healthcareapis.models.Operations; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -26,14 +26,14 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationDetailImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationDetailImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/PrivateEndpointConnectionsClientImpl.java index 119982024827..29be0cd2ff1c 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/PrivateEndpointConnectionsClientImpl.java @@ -143,7 +143,8 @@ Mono>> delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServiceSinglePageAsync( @@ -196,7 +197,8 @@ private Mono> listBySer * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServiceSinglePageAsync( @@ -245,7 +247,8 @@ private Mono> listBySer * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByServiceAsync( @@ -262,7 +265,8 @@ private PagedFlux listByServiceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByServiceAsync( @@ -278,7 +282,8 @@ private PagedFlux listByServiceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByService( @@ -295,7 +300,8 @@ public PagedIterable listByService( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByService( @@ -313,7 +319,8 @@ public PagedIterable listByService( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the service. + * @return the specified private endpoint connection associated with the service along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -371,7 +378,8 @@ private Mono> getWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the service. + * @return the specified private endpoint connection associated with the service along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -425,7 +433,8 @@ private Mono> getWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the service. + * @return the specified private endpoint connection associated with the service on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -470,7 +479,7 @@ public PrivateEndpointConnectionDescriptionInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the service. + * @return the specified private endpoint connection associated with the service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -489,7 +498,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -557,7 +567,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -622,9 +633,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -640,7 +651,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getHttpPipeline(), PrivateEndpointConnectionDescriptionInner.class, PrivateEndpointConnectionDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -655,9 +666,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -690,9 +701,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -715,9 +726,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -741,7 +752,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -766,7 +777,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -838,7 +849,7 @@ public PrivateEndpointConnectionDescriptionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -896,7 +907,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -950,16 +961,17 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -973,9 +985,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); @@ -996,9 +1008,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).getSyncPoller(); @@ -1015,9 +1027,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) @@ -1034,7 +1046,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -1055,7 +1067,7 @@ private Mono deleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/PrivateLinkResourcesClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/PrivateLinkResourcesClientImpl.java index 608968bb1de5..273117c98211 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/PrivateLinkResourcesClientImpl.java @@ -96,7 +96,8 @@ Mono> get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a service. + * @return the private link resources that need to be created for a service along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServiceWithResponseAsync( @@ -145,7 +146,8 @@ private Mono> listByServ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a service. + * @return the private link resources that need to be created for a service along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByServiceWithResponseAsync( @@ -190,7 +192,8 @@ private Mono> listByServ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a service. + * @return the private link resources that need to be created for a service on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listByServiceAsync( @@ -230,7 +233,7 @@ public PrivateLinkResourceListResultDescriptionInner listByService(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a service. + * @return the private link resources that need to be created for a service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listByServiceWithResponse( @@ -247,7 +250,8 @@ public Response listByServiceWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource that need to be created for a service. + * @return a private link resource that need to be created for a service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -301,7 +305,8 @@ private Mono> getWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource that need to be created for a service. + * @return a private link resource that need to be created for a service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -351,7 +356,7 @@ private Mono> getWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource that need to be created for a service. + * @return a private link resource that need to be created for a service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -393,7 +398,7 @@ public PrivateLinkResourceDescriptionInner get(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource that need to be created for a service. + * @return a private link resource that need to be created for a service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/ServicesClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/ServicesClientImpl.java index 570a825d4d38..35ae7c7ac691 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/ServicesClientImpl.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/ServicesClientImpl.java @@ -199,7 +199,7 @@ Mono> listByResourceGroupNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of a service instance. + * @return the metadata of a service instance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -248,7 +248,7 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of a service instance. + * @return the metadata of a service instance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -293,7 +293,7 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of a service instance. + * @return the metadata of a service instance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { @@ -332,7 +332,7 @@ public ServicesDescriptionInner getByResourceGroup(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of a service instance. + * @return the metadata of a service instance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -349,7 +349,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the description of the service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -406,7 +406,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the description of the service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -459,9 +459,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link PollerFlux} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServicesDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription) { Mono>> mono = @@ -473,7 +473,7 @@ private PollerFlux, ServicesDescriptionInne this.client.getHttpPipeline(), ServicesDescriptionInner.class, ServicesDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -486,9 +486,9 @@ private PollerFlux, ServicesDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link PollerFlux} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServicesDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription, Context context) { context = this.client.mergeContext(context); @@ -513,9 +513,9 @@ private PollerFlux, ServicesDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link SyncPoller} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServicesDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription) { return beginCreateOrUpdateAsync(resourceGroupName, resourceName, serviceDescription).getSyncPoller(); @@ -531,9 +531,9 @@ public SyncPoller, ServicesDescriptionInner * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link SyncPoller} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServicesDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, resourceName, serviceDescription, context).getSyncPoller(); @@ -548,7 +548,7 @@ public SyncPoller, ServicesDescriptionInner * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the description of the service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -568,7 +568,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the description of the service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -622,7 +622,7 @@ public ServicesDescriptionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the description of the service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -680,7 +680,7 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the description of the service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -737,9 +737,9 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link PollerFlux} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServicesDescriptionInner> beginUpdateAsync( String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription) { Mono>> mono = @@ -751,7 +751,7 @@ private PollerFlux, ServicesDescriptionInne this.client.getHttpPipeline(), ServicesDescriptionInner.class, ServicesDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -764,9 +764,9 @@ private PollerFlux, ServicesDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link PollerFlux} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServicesDescriptionInner> beginUpdateAsync( String resourceGroupName, String resourceName, @@ -794,9 +794,9 @@ private PollerFlux, ServicesDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link SyncPoller} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServicesDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription) { return beginUpdateAsync(resourceGroupName, resourceName, servicePatchDescription).getSyncPoller(); @@ -812,9 +812,9 @@ public SyncPoller, ServicesDescriptionInner * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the {@link SyncPoller} for polling of the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServicesDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -832,7 +832,7 @@ public SyncPoller, ServicesDescriptionInner * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the description of the service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -852,7 +852,7 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the service. + * @return the description of the service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -911,7 +911,7 @@ public ServicesDescriptionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { @@ -959,7 +959,7 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1004,14 +1004,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1023,9 +1024,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceName, Context context) { context = this.client.mergeContext(context); @@ -1043,9 +1044,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); } @@ -1059,9 +1060,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); @@ -1075,7 +1076,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String resourceName) { @@ -1091,7 +1092,7 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { @@ -1134,7 +1135,8 @@ public void delete(String resourceGroupName, String resourceName, Context contex * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1180,7 +1182,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1221,7 +1224,7 @@ private Mono> listSinglePageAsync(Contex * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1235,7 +1238,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1248,7 +1251,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1262,7 +1265,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1276,7 +1279,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -1328,7 +1332,8 @@ private Mono> listByResourceGroupSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1377,7 +1382,7 @@ private Mono> listByResourceGroupSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -1394,7 +1399,7 @@ private PagedFlux listByResourceGroupAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -1410,7 +1415,7 @@ private PagedFlux listByResourceGroupAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1425,7 +1430,7 @@ public PagedIterable listByResourceGroup(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -1440,7 +1445,8 @@ public PagedIterable listByResourceGroup(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given service name is available. + * @return the properties indicating whether a given service name is available along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1489,7 +1495,8 @@ private Mono> checkNameAvailabilityW * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given service name is available. + * @return the properties indicating whether a given service name is available along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1534,7 +1541,8 @@ private Mono> checkNameAvailabilityW * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given service name is available. + * @return the properties indicating whether a given service name is available on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync( @@ -1575,7 +1583,7 @@ public ServicesNameAvailabilityInfoInner checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given service name is available. + * @return the properties indicating whether a given service name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse( @@ -1590,7 +1598,8 @@ public Response checkNameAvailabilityWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service description objects with a next link. + * @return a list of service description objects with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1626,7 +1635,8 @@ private Mono> listNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service description objects with a next link. + * @return a list of service description objects with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1661,7 +1671,8 @@ private Mono> listNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service description objects with a next link. + * @return a list of service description objects with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1698,7 +1709,8 @@ private Mono> listByResourceGroupNextSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service description objects with a next link. + * @return a list of service description objects with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspaceImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspaceImpl.java new file mode 100644 index 000000000000..cc5d1cef231e --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspaceImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.healthcareapis.models.Workspace; +import com.azure.resourcemanager.healthcareapis.models.WorkspacePatchResource; +import com.azure.resourcemanager.healthcareapis.models.WorkspaceProperties; +import java.util.Collections; +import java.util.Map; + +public final class WorkspaceImpl implements Workspace, Workspace.Definition, Workspace.Update { + private WorkspaceInner innerObject; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public WorkspaceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public WorkspaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private WorkspacePatchResource updateWorkspacePatchResource; + + public WorkspaceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Workspace create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, workspaceName, this.innerModel(), Context.NONE); + return this; + } + + public Workspace create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, workspaceName, this.innerModel(), context); + return this; + } + + WorkspaceImpl(String name, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = new WorkspaceInner(); + this.serviceManager = serviceManager; + this.workspaceName = name; + } + + public WorkspaceImpl update() { + this.updateWorkspacePatchResource = new WorkspacePatchResource(); + return this; + } + + public Workspace apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .update(resourceGroupName, workspaceName, updateWorkspacePatchResource, Context.NONE); + return this; + } + + public Workspace apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .update(resourceGroupName, workspaceName, updateWorkspacePatchResource, context); + return this; + } + + WorkspaceImpl( + WorkspaceInner innerObject, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + } + + public Workspace refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE) + .getValue(); + return this; + } + + public Workspace refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .getByResourceGroupWithResponse(resourceGroupName, workspaceName, context) + .getValue(); + return this; + } + + public WorkspaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public WorkspaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public WorkspaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateWorkspacePatchResource.withTags(tags); + return this; + } + } + + public WorkspaceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public WorkspaceImpl withProperties(WorkspaceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateEndpointConnectionsClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..77585d64bae6 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.WorkspacePrivateEndpointConnectionsClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateEndpointConnectionDescriptionInner; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnectionListResultDescription; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WorkspacePrivateEndpointConnectionsClient. + */ +public final class WorkspacePrivateEndpointConnectionsClientImpl implements WorkspacePrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(WorkspacePrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspacePrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of WorkspacePrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspacePrivateEndpointConnectionsClientImpl(HealthcareApisManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspacePrivateEndpointConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HealthcareApisManagementClientWorkspacePrivateEndpointConnections to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HealthcareApisManage") + private interface WorkspacePrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionDescriptionInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + } + + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the workspace along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the workspace along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Gets the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the workspace on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionDescriptionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).block(); + } + + /** + * Gets the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + properties, + accept, + context); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionDescriptionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, properties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionDescriptionInner.class, + PrivateEndpointConnectionDescriptionInner.class, + this.client.getContext()); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionDescriptionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, properties, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionDescriptionInner.class, + PrivateEndpointConnectionDescriptionInner.class, + context); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionDescriptionInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, properties) + .getSyncPoller(); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionDescriptionInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, properties, context) + .getSyncPoller(); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionDescriptionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties) { + return createOrUpdateAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, properties).block(); + } + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionDescriptionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, properties, context) + .block(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).block(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateEndpointConnectionsImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..8e5c6236c0a4 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateEndpointConnectionsImpl.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.WorkspacePrivateEndpointConnectionsClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateEndpointConnectionDescriptionInner; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointConnectionDescription; +import com.azure.resourcemanager.healthcareapis.models.WorkspacePrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspacePrivateEndpointConnectionsImpl implements WorkspacePrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspacePrivateEndpointConnectionsImpl.class); + + private final WorkspacePrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public WorkspacePrivateEndpointConnectionsImpl( + WorkspacePrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionDescriptionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnectionDescription get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionDescriptionInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnectionDescription createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties) { + PrivateEndpointConnectionDescriptionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, workspaceName, privateEndpointConnectionName, properties); + if (inner != null) { + return new PrivateEndpointConnectionDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnectionDescription createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties, + Context context) { + PrivateEndpointConnectionDescriptionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, workspaceName, privateEndpointConnectionName, properties, context); + if (inner != null) { + return new PrivateEndpointConnectionDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, workspaceName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + } + + private WorkspacePrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateLinkResourcesClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..3e3d3af90105 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateLinkResourcesClientImpl.java @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.WorkspacePrivateLinkResourcesClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateLinkResourceDescriptionInner; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateLinkResourceListResultDescriptionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkspacePrivateLinkResourcesClient. */ +public final class WorkspacePrivateLinkResourcesClientImpl implements WorkspacePrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(WorkspacePrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspacePrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of WorkspacePrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspacePrivateLinkResourcesClientImpl(HealthcareApisManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspacePrivateLinkResourcesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HealthcareApisManagementClientWorkspacePrivateLinkResources to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HealthcareApisManage") + private interface WorkspacePrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}/privateLinkResources/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("groupName") String groupName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Gets a private link resource that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource that need to be created for a workspace along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String groupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + groupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private link resource that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param groupName The name of the private link resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource that need to be created for a workspace along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String groupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + groupName, + accept, + context); + } + + /** + * Gets a private link resource that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource that need to be created for a workspace on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String groupName) { + return getWithResponseAsync(resourceGroupName, workspaceName, groupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a private link resource that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource that need to be created for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceDescriptionInner get(String resourceGroupName, String workspaceName, String groupName) { + return getAsync(resourceGroupName, workspaceName, groupName).block(); + } + + /** + * Gets a private link resource that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param groupName The name of the private link resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource that need to be created for a workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String groupName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, groupName, context).block(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateLinkResourcesImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..49753048c4b1 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacePrivateLinkResourcesImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.WorkspacePrivateLinkResourcesClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateLinkResourceDescriptionInner; +import com.azure.resourcemanager.healthcareapis.models.PrivateLinkResourceDescription; +import com.azure.resourcemanager.healthcareapis.models.WorkspacePrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspacePrivateLinkResourcesImpl implements WorkspacePrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspacePrivateLinkResourcesImpl.class); + + private final WorkspacePrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public WorkspacePrivateLinkResourcesImpl( + WorkspacePrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceDescriptionImpl(inner1, this.manager())); + } + + public PrivateLinkResourceDescription get(String resourceGroupName, String workspaceName, String groupName) { + PrivateLinkResourceDescriptionInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, groupName); + if (inner != null) { + return new PrivateLinkResourceDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String groupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, groupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private WorkspacePrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesClientImpl.java new file mode 100644 index 000000000000..4c77d8302d07 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesClientImpl.java @@ -0,0 +1,1567 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.healthcareapis.fluent.WorkspacesClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.healthcareapis.models.WorkspaceList; +import com.azure.resourcemanager.healthcareapis.models.WorkspacePatchResource; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkspacesClient. */ +public final class WorkspacesClientImpl implements WorkspacesClient { + private final ClientLogger logger = new ClientLogger(WorkspacesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspacesService service; + + /** The service client containing this operation class. */ + private final HealthcareApisManagementClientImpl client; + + /** + * Initializes an instance of WorkspacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspacesClientImpl(HealthcareApisManagementClientImpl client) { + this.service = + RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HealthcareApisManagementClientWorkspaces to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HealthcareApisManage") + private interface WorkspacesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspaceInner workspace, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspacePatchResource workspacePatchResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis" + + "/workspaces/{workspaceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the available workspaces under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available workspaces under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the available workspaces under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available workspaces under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available workspaces under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the available workspaces under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the properties of the specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + accept, + context); + } + + /** + * Gets the properties of the specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { + return getByResourceGroupAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Gets the properties of the specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspace == null) { + return Mono.error(new IllegalArgumentException("Parameter workspace is required and cannot be null.")); + } else { + workspace.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + workspace, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspace == null) { + return Mono.error(new IllegalArgumentException("Parameter workspace is required and cannot be null.")); + } else { + workspace.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + workspace, + accept, + context); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspace); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkspaceInner.class, + WorkspaceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspace, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, context); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, workspace).getSyncPoller(); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, workspace, context).getSyncPoller(); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, workspace) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, workspace, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + return createOrUpdateAsync(resourceGroupName, workspaceName, workspace).block(); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, workspace, context).block(); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspacePatchResource workspacePatchResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspacePatchResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workspacePatchResource is required and cannot be null.")); + } else { + workspacePatchResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + workspacePatchResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + WorkspacePatchResource workspacePatchResource, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspacePatchResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workspacePatchResource is required and cannot be null.")); + } else { + workspacePatchResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + workspaceName, + workspacePatchResource, + accept, + context); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WorkspaceInner> beginUpdateAsync( + String resourceGroupName, String workspaceName, WorkspacePatchResource workspacePatchResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, workspaceName, workspacePatchResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkspaceInner.class, + WorkspaceInner.class, + this.client.getContext()); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WorkspaceInner> beginUpdateAsync( + String resourceGroupName, + String workspaceName, + WorkspacePatchResource workspacePatchResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, workspaceName, workspacePatchResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, context); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WorkspaceInner> beginUpdate( + String resourceGroupName, String workspaceName, WorkspacePatchResource workspacePatchResource) { + return beginUpdateAsync(resourceGroupName, workspaceName, workspacePatchResource).getSyncPoller(); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of workspace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WorkspaceInner> beginUpdate( + String resourceGroupName, + String workspaceName, + WorkspacePatchResource workspacePatchResource, + Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, workspacePatchResource, context).getSyncPoller(); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String workspaceName, WorkspacePatchResource workspacePatchResource) { + return beginUpdateAsync(resourceGroupName, workspaceName, workspacePatchResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + WorkspacePatchResource workspacePatchResource, + Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, workspacePatchResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner update( + String resourceGroupName, String workspaceName, WorkspacePatchResource workspacePatchResource) { + return updateAsync(resourceGroupName, workspaceName, workspacePatchResource).block(); + } + + /** + * Patch workspace details. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner update( + String resourceGroupName, + String workspaceName, + WorkspacePatchResource workspacePatchResource, + Context context) { + return updateAsync(resourceGroupName, workspaceName, workspacePatchResource, context).block(); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, workspaceName).getSyncPoller(); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, workspaceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName) { + deleteAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, Context context) { + deleteAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesImpl.java new file mode 100644 index 000000000000..4c62c62fcb1b --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.WorkspacesClient; +import com.azure.resourcemanager.healthcareapis.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.healthcareapis.models.Workspace; +import com.azure.resourcemanager.healthcareapis.models.Workspaces; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspacesImpl implements Workspaces { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspacesImpl.class); + + private final WorkspacesClient innerClient; + + private final com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager; + + public WorkspacesImpl( + WorkspacesClient innerClient, com.azure.resourcemanager.healthcareapis.HealthcareApisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public Workspace getByResourceGroup(String resourceGroupName, String workspaceName) { + WorkspaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, workspaceName); + if (inner != null) { + return new WorkspaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkspaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String workspaceName) { + this.serviceClient().delete(resourceGroupName, workspaceName); + } + + public void delete(String resourceGroupName, String workspaceName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, context); + } + + public Workspace getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, workspaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, workspaceName, context); + } + + private WorkspacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager() { + return this.serviceManager; + } + + public WorkspaceImpl define(String name) { + return new WorkspaceImpl(name, this.manager()); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ActionType.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ActionType.java new file mode 100644 index 000000000000..599b4f1b8929 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ActionType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** @return known ActionType values. */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomService.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomService.java new file mode 100644 index 000000000000..65f3baf79862 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomService.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.DicomServiceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DicomService. */ +public interface DicomService { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: An etag associated with the resource, used for optimistic concurrency when editing it. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the location property: The resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + ServiceManagedIdentityIdentity identity(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the authenticationConfiguration property: Dicom Service authentication configuration. + * + * @return the authenticationConfiguration value. + */ + DicomServiceAuthenticationConfiguration authenticationConfiguration(); + + /** + * Gets the serviceUrl property: The url of the Dicom Services. + * + * @return the serviceUrl value. + */ + String serviceUrl(); + + /** + * Gets the privateEndpointConnections property: The list of private endpoint connections that are set up for this + * resource. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.healthcareapis.fluent.models.DicomServiceInner object. + * + * @return the inner object. + */ + DicomServiceInner innerModel(); + + /** The entirety of the DicomService definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DicomService definition stages. */ + interface DefinitionStages { + /** The first stage of the DicomService definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DicomService definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the DicomService definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithTags, + DefinitionStages.WithEtag, + DefinitionStages.WithIdentity, + DefinitionStages.WithAuthenticationConfiguration, + DefinitionStages.WithPublicNetworkAccess { + /** + * Executes the create request. + * + * @return the created resource. + */ + DicomService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DicomService create(Context context); + } + /** The stage of the DicomService definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the DicomService definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DicomService definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: An etag associated with the resource, used for optimistic concurrency when + * editing it.. + * + * @param etag An etag associated with the resource, used for optimistic concurrency when editing it. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the DicomService definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Setting indicating whether the service has a managed identity associated + * with it.. + * + * @param identity Setting indicating whether the service has a managed identity associated with it. + * @return the next definition stage. + */ + WithCreate withIdentity(ServiceManagedIdentityIdentity identity); + } + /** The stage of the DicomService definition allowing to specify authenticationConfiguration. */ + interface WithAuthenticationConfiguration { + /** + * Specifies the authenticationConfiguration property: Dicom Service authentication configuration.. + * + * @param authenticationConfiguration Dicom Service authentication configuration. + * @return the next definition stage. + */ + WithCreate withAuthenticationConfiguration( + DicomServiceAuthenticationConfiguration authenticationConfiguration); + } + /** The stage of the DicomService definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Control permission for data plane traffic coming from public + * networks while private endpoint is enabled.. + * + * @param publicNetworkAccess Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + } + /** + * Begins update for the DicomService resource. + * + * @return the stage of resource update. + */ + DicomService.Update update(); + + /** The template for DicomService update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DicomService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DicomService apply(Context context); + } + /** The DicomService update stages. */ + interface UpdateStages { + /** The stage of the DicomService update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the DicomService update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Setting indicating whether the service has a managed identity associated + * with it.. + * + * @param identity Setting indicating whether the service has a managed identity associated with it. + * @return the next definition stage. + */ + Update withIdentity(ServiceManagedIdentityIdentity identity); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DicomService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DicomService refresh(Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServiceAuthenticationConfiguration.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServiceAuthenticationConfiguration.java new file mode 100644 index 000000000000..49d76a75710f --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServiceAuthenticationConfiguration.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Authentication configuration information. */ +@Immutable +public final class DicomServiceAuthenticationConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DicomServiceAuthenticationConfiguration.class); + + /* + * The authority url for the service + */ + @JsonProperty(value = "authority", access = JsonProperty.Access.WRITE_ONLY) + private String authority; + + /* + * The audiences for the service + */ + @JsonProperty(value = "audiences", access = JsonProperty.Access.WRITE_ONLY) + private List audiences; + + /** + * Get the authority property: The authority url for the service. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Get the audiences property: The audiences for the service. + * + * @return the audiences value. + */ + public List audiences() { + return this.audiences; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServiceCollection.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServiceCollection.java new file mode 100644 index 000000000000..f5197979cb99 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServiceCollection.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.models.DicomServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of Dicom Services. */ +@Fluent +public final class DicomServiceCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DicomServiceCollection.class); + + /* + * The link used to get the next page of Dicom Services. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of Dicom Services. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: The link used to get the next page of Dicom Services. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of Dicom Services. + * + * @param nextLink the nextLink value to set. + * @return the DicomServiceCollection object itself. + */ + public DicomServiceCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of Dicom Services. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Dicom Services. + * + * @param value the value value to set. + * @return the DicomServiceCollection object itself. + */ + public DicomServiceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServicePatchResource.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServicePatchResource.java new file mode 100644 index 000000000000..0eb14750e398 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServicePatchResource.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Dicom Service patch properties. */ +@Fluent +public final class DicomServicePatchResource extends ResourceTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DicomServicePatchResource.class); + + /* + * Setting indicating whether the service has a managed identity associated + * with it. + */ + @JsonProperty(value = "identity") + private ServiceManagedIdentityIdentity identity; + + /** + * Get the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + public ServiceManagedIdentityIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @param identity the identity value to set. + * @return the DicomServicePatchResource object itself. + */ + public DicomServicePatchResource withIdentity(ServiceManagedIdentityIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public DicomServicePatchResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServices.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServices.java new file mode 100644 index 000000000000..df37f3585ff9 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServices.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DicomServices. */ +public interface DicomServices { + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services as paginated response with {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Lists all DICOM Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Dicom Services as paginated response with {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the properties of the specified DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service. + */ + DicomService get(String resourceGroupName, String workspaceName, String dicomServiceName); + + /** + * Gets the properties of the specified DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String dicomServiceName, Context context); + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dicomServiceName, String workspaceName); + + /** + * Deletes a DICOM Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dicomServiceName, String workspaceName, Context context); + + /** + * Gets the properties of the specified DICOM Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service along with {@link Response}. + */ + DicomService getById(String id); + + /** + * Gets the properties of the specified DICOM Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified DICOM Service along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a DICOM Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a DICOM Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DicomService resource. + * + * @param name resource name. + * @return the first stage of the new DicomService definition. + */ + DicomService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirDestinations.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirDestinations.java new file mode 100644 index 000000000000..7a53a38c6300 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirDestinations.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of FhirDestinations. */ +public interface FhirDestinations { + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations as paginated response with {@link PagedIterable}. + */ + PagedIterable listByIotConnector( + String resourceGroupName, String workspaceName, String iotConnectorName); + + /** + * Lists all FHIR destinations for the given IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connector FHIR destinations as paginated response with {@link PagedIterable}. + */ + PagedIterable listByIotConnector( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirResourceVersionPolicy.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirResourceVersionPolicy.java new file mode 100644 index 000000000000..ac76fb2cca9b --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirResourceVersionPolicy.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FhirResourceVersionPolicy. */ +public final class FhirResourceVersionPolicy extends ExpandableStringEnum { + /** Static value no-version for FhirResourceVersionPolicy. */ + public static final FhirResourceVersionPolicy NO_VERSION = fromString("no-version"); + + /** Static value versioned for FhirResourceVersionPolicy. */ + public static final FhirResourceVersionPolicy VERSIONED = fromString("versioned"); + + /** Static value versioned-update for FhirResourceVersionPolicy. */ + public static final FhirResourceVersionPolicy VERSIONED_UPDATE = fromString("versioned-update"); + + /** + * Creates or finds a FhirResourceVersionPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding FhirResourceVersionPolicy. + */ + @JsonCreator + public static FhirResourceVersionPolicy fromString(String name) { + return fromString(name, FhirResourceVersionPolicy.class); + } + + /** @return known FhirResourceVersionPolicy values. */ + public static Collection values() { + return values(FhirResourceVersionPolicy.class); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirService.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirService.java new file mode 100644 index 000000000000..81d36190eba9 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirService.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.FhirServiceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of FhirService. */ +public interface FhirService { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: An etag associated with the resource, used for optimistic concurrency when editing it. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the location property: The resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the kind property: The kind of the service. + * + * @return the kind value. + */ + FhirServiceKind kind(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + ServiceManagedIdentityIdentity identity(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the accessPolicies property: Fhir Service access policies. + * + * @return the accessPolicies value. + */ + List accessPolicies(); + + /** + * Gets the acrConfiguration property: Fhir Service Azure container registry configuration. + * + * @return the acrConfiguration value. + */ + FhirServiceAcrConfiguration acrConfiguration(); + + /** + * Gets the authenticationConfiguration property: Fhir Service authentication configuration. + * + * @return the authenticationConfiguration value. + */ + FhirServiceAuthenticationConfiguration authenticationConfiguration(); + + /** + * Gets the corsConfiguration property: Fhir Service Cors configuration. + * + * @return the corsConfiguration value. + */ + FhirServiceCorsConfiguration corsConfiguration(); + + /** + * Gets the exportConfiguration property: Fhir Service export configuration. + * + * @return the exportConfiguration value. + */ + FhirServiceExportConfiguration exportConfiguration(); + + /** + * Gets the privateEndpointConnections property: The list of private endpoint connections that are set up for this + * resource. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the eventState property: Fhir Service event support status. + * + * @return the eventState value. + */ + ServiceEventState eventState(); + + /** + * Gets the resourceVersionPolicyConfiguration property: Determines tracking of history for resources. + * + * @return the resourceVersionPolicyConfiguration value. + */ + ResourceVersionPolicyConfiguration resourceVersionPolicyConfiguration(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.healthcareapis.fluent.models.FhirServiceInner object. + * + * @return the inner object. + */ + FhirServiceInner innerModel(); + + /** The entirety of the FhirService definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The FhirService definition stages. */ + interface DefinitionStages { + /** The first stage of the FhirService definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the FhirService definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the FhirService definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithTags, + DefinitionStages.WithEtag, + DefinitionStages.WithKind, + DefinitionStages.WithIdentity, + DefinitionStages.WithAccessPolicies, + DefinitionStages.WithAcrConfiguration, + DefinitionStages.WithAuthenticationConfiguration, + DefinitionStages.WithCorsConfiguration, + DefinitionStages.WithExportConfiguration, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithResourceVersionPolicyConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + FhirService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FhirService create(Context context); + } + /** The stage of the FhirService definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the FhirService definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the FhirService definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: An etag associated with the resource, used for optimistic concurrency when + * editing it.. + * + * @param etag An etag associated with the resource, used for optimistic concurrency when editing it. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the FhirService definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind of the service.. + * + * @param kind The kind of the service. + * @return the next definition stage. + */ + WithCreate withKind(FhirServiceKind kind); + } + /** The stage of the FhirService definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Setting indicating whether the service has a managed identity associated + * with it.. + * + * @param identity Setting indicating whether the service has a managed identity associated with it. + * @return the next definition stage. + */ + WithCreate withIdentity(ServiceManagedIdentityIdentity identity); + } + /** The stage of the FhirService definition allowing to specify accessPolicies. */ + interface WithAccessPolicies { + /** + * Specifies the accessPolicies property: Fhir Service access policies.. + * + * @param accessPolicies Fhir Service access policies. + * @return the next definition stage. + */ + WithCreate withAccessPolicies(List accessPolicies); + } + /** The stage of the FhirService definition allowing to specify acrConfiguration. */ + interface WithAcrConfiguration { + /** + * Specifies the acrConfiguration property: Fhir Service Azure container registry configuration.. + * + * @param acrConfiguration Fhir Service Azure container registry configuration. + * @return the next definition stage. + */ + WithCreate withAcrConfiguration(FhirServiceAcrConfiguration acrConfiguration); + } + /** The stage of the FhirService definition allowing to specify authenticationConfiguration. */ + interface WithAuthenticationConfiguration { + /** + * Specifies the authenticationConfiguration property: Fhir Service authentication configuration.. + * + * @param authenticationConfiguration Fhir Service authentication configuration. + * @return the next definition stage. + */ + WithCreate withAuthenticationConfiguration( + FhirServiceAuthenticationConfiguration authenticationConfiguration); + } + /** The stage of the FhirService definition allowing to specify corsConfiguration. */ + interface WithCorsConfiguration { + /** + * Specifies the corsConfiguration property: Fhir Service Cors configuration.. + * + * @param corsConfiguration Fhir Service Cors configuration. + * @return the next definition stage. + */ + WithCreate withCorsConfiguration(FhirServiceCorsConfiguration corsConfiguration); + } + /** The stage of the FhirService definition allowing to specify exportConfiguration. */ + interface WithExportConfiguration { + /** + * Specifies the exportConfiguration property: Fhir Service export configuration.. + * + * @param exportConfiguration Fhir Service export configuration. + * @return the next definition stage. + */ + WithCreate withExportConfiguration(FhirServiceExportConfiguration exportConfiguration); + } + /** The stage of the FhirService definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Control permission for data plane traffic coming from public + * networks while private endpoint is enabled.. + * + * @param publicNetworkAccess Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the FhirService definition allowing to specify resourceVersionPolicyConfiguration. */ + interface WithResourceVersionPolicyConfiguration { + /** + * Specifies the resourceVersionPolicyConfiguration property: Determines tracking of history for resources.. + * + * @param resourceVersionPolicyConfiguration Determines tracking of history for resources. + * @return the next definition stage. + */ + WithCreate withResourceVersionPolicyConfiguration( + ResourceVersionPolicyConfiguration resourceVersionPolicyConfiguration); + } + } + /** + * Begins update for the FhirService resource. + * + * @return the stage of resource update. + */ + FhirService.Update update(); + + /** The template for FhirService update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FhirService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FhirService apply(Context context); + } + /** The FhirService update stages. */ + interface UpdateStages { + /** The stage of the FhirService update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the FhirService update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Setting indicating whether the service has a managed identity associated + * with it.. + * + * @param identity Setting indicating whether the service has a managed identity associated with it. + * @return the next definition stage. + */ + Update withIdentity(ServiceManagedIdentityIdentity identity); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FhirService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FhirService refresh(Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAccessPolicyEntry.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAccessPolicyEntry.java new file mode 100644 index 000000000000..1bdef448d3a4 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAccessPolicyEntry.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An access policy entry. */ +@Fluent +public final class FhirServiceAccessPolicyEntry { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServiceAccessPolicyEntry.class); + + /* + * An Azure AD object ID (User or Apps) that is allowed access to the FHIR + * service. + */ + @JsonProperty(value = "objectId", required = true) + private String objectId; + + /** + * Get the objectId property: An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + * + * @param objectId the objectId value to set. + * @return the FhirServiceAccessPolicyEntry object itself. + */ + public FhirServiceAccessPolicyEntry withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (objectId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property objectId in model FhirServiceAccessPolicyEntry")); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAcrConfiguration.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAcrConfiguration.java new file mode 100644 index 000000000000..75968f2b1823 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAcrConfiguration.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure container registry configuration information. */ +@Fluent +public final class FhirServiceAcrConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServiceAcrConfiguration.class); + + /* + * The list of the Azure container registry login servers. + */ + @JsonProperty(value = "loginServers") + private List loginServers; + + /* + * The list of Open Container Initiative (OCI) artifacts. + */ + @JsonProperty(value = "ociArtifacts") + private List ociArtifacts; + + /** + * Get the loginServers property: The list of the Azure container registry login servers. + * + * @return the loginServers value. + */ + public List loginServers() { + return this.loginServers; + } + + /** + * Set the loginServers property: The list of the Azure container registry login servers. + * + * @param loginServers the loginServers value to set. + * @return the FhirServiceAcrConfiguration object itself. + */ + public FhirServiceAcrConfiguration withLoginServers(List loginServers) { + this.loginServers = loginServers; + return this; + } + + /** + * Get the ociArtifacts property: The list of Open Container Initiative (OCI) artifacts. + * + * @return the ociArtifacts value. + */ + public List ociArtifacts() { + return this.ociArtifacts; + } + + /** + * Set the ociArtifacts property: The list of Open Container Initiative (OCI) artifacts. + * + * @param ociArtifacts the ociArtifacts value to set. + * @return the FhirServiceAcrConfiguration object itself. + */ + public FhirServiceAcrConfiguration withOciArtifacts(List ociArtifacts) { + this.ociArtifacts = ociArtifacts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ociArtifacts() != null) { + ociArtifacts().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAuthenticationConfiguration.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAuthenticationConfiguration.java new file mode 100644 index 000000000000..25489e150022 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAuthenticationConfiguration.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authentication configuration information. */ +@Fluent +public final class FhirServiceAuthenticationConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServiceAuthenticationConfiguration.class); + + /* + * The authority url for the service + */ + @JsonProperty(value = "authority") + private String authority; + + /* + * The audience url for the service + */ + @JsonProperty(value = "audience") + private String audience; + + /* + * If the SMART on FHIR proxy is enabled + */ + @JsonProperty(value = "smartProxyEnabled") + private Boolean smartProxyEnabled; + + /** + * Get the authority property: The authority url for the service. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority property: The authority url for the service. + * + * @param authority the authority value to set. + * @return the FhirServiceAuthenticationConfiguration object itself. + */ + public FhirServiceAuthenticationConfiguration withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the audience property: The audience url for the service. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience property: The audience url for the service. + * + * @param audience the audience value to set. + * @return the FhirServiceAuthenticationConfiguration object itself. + */ + public FhirServiceAuthenticationConfiguration withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the smartProxyEnabled property: If the SMART on FHIR proxy is enabled. + * + * @return the smartProxyEnabled value. + */ + public Boolean smartProxyEnabled() { + return this.smartProxyEnabled; + } + + /** + * Set the smartProxyEnabled property: If the SMART on FHIR proxy is enabled. + * + * @param smartProxyEnabled the smartProxyEnabled value to set. + * @return the FhirServiceAuthenticationConfiguration object itself. + */ + public FhirServiceAuthenticationConfiguration withSmartProxyEnabled(Boolean smartProxyEnabled) { + this.smartProxyEnabled = smartProxyEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceCollection.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceCollection.java new file mode 100644 index 000000000000..d728e5145a2c --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceCollection.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.models.FhirServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of Fhir services. */ +@Fluent +public final class FhirServiceCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServiceCollection.class); + + /* + * The link used to get the next page of Fhir Services. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of Fhir Services. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: The link used to get the next page of Fhir Services. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of Fhir Services. + * + * @param nextLink the nextLink value to set. + * @return the FhirServiceCollection object itself. + */ + public FhirServiceCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of Fhir Services. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Fhir Services. + * + * @param value the value value to set. + * @return the FhirServiceCollection object itself. + */ + public FhirServiceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceCorsConfiguration.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceCorsConfiguration.java new file mode 100644 index 000000000000..bd3eca8af281 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceCorsConfiguration.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The settings for the CORS configuration of the service instance. */ +@Fluent +public final class FhirServiceCorsConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServiceCorsConfiguration.class); + + /* + * The origins to be allowed via CORS. + */ + @JsonProperty(value = "origins") + private List origins; + + /* + * The headers to be allowed via CORS. + */ + @JsonProperty(value = "headers") + private List headers; + + /* + * The methods to be allowed via CORS. + */ + @JsonProperty(value = "methods") + private List methods; + + /* + * The max age to be allowed via CORS. + */ + @JsonProperty(value = "maxAge") + private Integer maxAge; + + /* + * If credentials are allowed via CORS. + */ + @JsonProperty(value = "allowCredentials") + private Boolean allowCredentials; + + /** + * Get the origins property: The origins to be allowed via CORS. + * + * @return the origins value. + */ + public List origins() { + return this.origins; + } + + /** + * Set the origins property: The origins to be allowed via CORS. + * + * @param origins the origins value to set. + * @return the FhirServiceCorsConfiguration object itself. + */ + public FhirServiceCorsConfiguration withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get the headers property: The headers to be allowed via CORS. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: The headers to be allowed via CORS. + * + * @param headers the headers value to set. + * @return the FhirServiceCorsConfiguration object itself. + */ + public FhirServiceCorsConfiguration withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get the methods property: The methods to be allowed via CORS. + * + * @return the methods value. + */ + public List methods() { + return this.methods; + } + + /** + * Set the methods property: The methods to be allowed via CORS. + * + * @param methods the methods value to set. + * @return the FhirServiceCorsConfiguration object itself. + */ + public FhirServiceCorsConfiguration withMethods(List methods) { + this.methods = methods; + return this; + } + + /** + * Get the maxAge property: The max age to be allowed via CORS. + * + * @return the maxAge value. + */ + public Integer maxAge() { + return this.maxAge; + } + + /** + * Set the maxAge property: The max age to be allowed via CORS. + * + * @param maxAge the maxAge value to set. + * @return the FhirServiceCorsConfiguration object itself. + */ + public FhirServiceCorsConfiguration withMaxAge(Integer maxAge) { + this.maxAge = maxAge; + return this; + } + + /** + * Get the allowCredentials property: If credentials are allowed via CORS. + * + * @return the allowCredentials value. + */ + public Boolean allowCredentials() { + return this.allowCredentials; + } + + /** + * Set the allowCredentials property: If credentials are allowed via CORS. + * + * @param allowCredentials the allowCredentials value to set. + * @return the FhirServiceCorsConfiguration object itself. + */ + public FhirServiceCorsConfiguration withAllowCredentials(Boolean allowCredentials) { + this.allowCredentials = allowCredentials; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceExportConfiguration.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceExportConfiguration.java new file mode 100644 index 000000000000..2f205fdcb187 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceExportConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Export operation configuration information. */ +@Fluent +public final class FhirServiceExportConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServiceExportConfiguration.class); + + /* + * The name of the default export storage account. + */ + @JsonProperty(value = "storageAccountName") + private String storageAccountName; + + /** + * Get the storageAccountName property: The name of the default export storage account. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: The name of the default export storage account. + * + * @param storageAccountName the storageAccountName value to set. + * @return the FhirServiceExportConfiguration object itself. + */ + public FhirServiceExportConfiguration withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceKind.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceKind.java new file mode 100644 index 000000000000..4b5799c52995 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceKind.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FhirServiceKind. */ +public final class FhirServiceKind extends ExpandableStringEnum { + /** Static value fhir-Stu3 for FhirServiceKind. */ + public static final FhirServiceKind FHIR_STU3 = fromString("fhir-Stu3"); + + /** Static value fhir-R4 for FhirServiceKind. */ + public static final FhirServiceKind FHIR_R4 = fromString("fhir-R4"); + + /** + * Creates or finds a FhirServiceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding FhirServiceKind. + */ + @JsonCreator + public static FhirServiceKind fromString(String name) { + return fromString(name, FhirServiceKind.class); + } + + /** @return known FhirServiceKind values. */ + public static Collection values() { + return values(FhirServiceKind.class); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServicePatchResource.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServicePatchResource.java new file mode 100644 index 000000000000..ef5c77c22ce1 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServicePatchResource.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** FhirService patch properties. */ +@Fluent +public final class FhirServicePatchResource extends ResourceTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FhirServicePatchResource.class); + + /* + * Setting indicating whether the service has a managed identity associated + * with it. + */ + @JsonProperty(value = "identity") + private ServiceManagedIdentityIdentity identity; + + /** + * Get the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + public ServiceManagedIdentityIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @param identity the identity value to set. + * @return the FhirServicePatchResource object itself. + */ + public FhirServicePatchResource withIdentity(ServiceManagedIdentityIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public FhirServicePatchResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServices.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServices.java new file mode 100644 index 000000000000..20f899eee3c5 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServices.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FhirServices. */ +public interface FhirServices { + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services as paginated response with {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Lists all FHIR Services for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Fhir services as paginated response with {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the properties of the specified FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service. + */ + FhirService get(String resourceGroupName, String workspaceName, String fhirServiceName); + + /** + * Gets the properties of the specified FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String fhirServiceName, Context context); + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String fhirServiceName, String workspaceName); + + /** + * Deletes a FHIR Service. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String fhirServiceName, String workspaceName, Context context); + + /** + * Gets the properties of the specified FHIR Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service along with {@link Response}. + */ + FhirService getById(String id); + + /** + * Gets the properties of the specified FHIR Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified FHIR Service along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a FHIR Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a FHIR Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FhirService resource. + * + * @param name resource name. + * @return the first stage of the new FhirService definition. + */ + FhirService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnector.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnector.java new file mode 100644 index 000000000000..47af832c6207 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnector.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotConnectorInner; +import java.util.Map; + +/** An immutable client-side representation of IotConnector. */ +public interface IotConnector { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: An etag associated with the resource, used for optimistic concurrency when editing it. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the location property: The resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + ServiceManagedIdentityIdentity identity(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the ingestionEndpointConfiguration property: Source configuration. + * + * @return the ingestionEndpointConfiguration value. + */ + IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration(); + + /** + * Gets the deviceMapping property: Device Mappings. + * + * @return the deviceMapping value. + */ + IotMappingProperties deviceMapping(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.healthcareapis.fluent.models.IotConnectorInner object. + * + * @return the inner object. + */ + IotConnectorInner innerModel(); + + /** The entirety of the IotConnector definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The IotConnector definition stages. */ + interface DefinitionStages { + /** The first stage of the IotConnector definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IotConnector definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** + * The stage of the IotConnector definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithTags, + DefinitionStages.WithEtag, + DefinitionStages.WithIdentity, + DefinitionStages.WithIngestionEndpointConfiguration, + DefinitionStages.WithDeviceMapping { + /** + * Executes the create request. + * + * @return the created resource. + */ + IotConnector create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IotConnector create(Context context); + } + /** The stage of the IotConnector definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the IotConnector definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the IotConnector definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: An etag associated with the resource, used for optimistic concurrency when + * editing it.. + * + * @param etag An etag associated with the resource, used for optimistic concurrency when editing it. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the IotConnector definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Setting indicating whether the service has a managed identity associated + * with it.. + * + * @param identity Setting indicating whether the service has a managed identity associated with it. + * @return the next definition stage. + */ + WithCreate withIdentity(ServiceManagedIdentityIdentity identity); + } + /** The stage of the IotConnector definition allowing to specify ingestionEndpointConfiguration. */ + interface WithIngestionEndpointConfiguration { + /** + * Specifies the ingestionEndpointConfiguration property: Source configuration.. + * + * @param ingestionEndpointConfiguration Source configuration. + * @return the next definition stage. + */ + WithCreate withIngestionEndpointConfiguration( + IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration); + } + /** The stage of the IotConnector definition allowing to specify deviceMapping. */ + interface WithDeviceMapping { + /** + * Specifies the deviceMapping property: Device Mappings.. + * + * @param deviceMapping Device Mappings. + * @return the next definition stage. + */ + WithCreate withDeviceMapping(IotMappingProperties deviceMapping); + } + } + /** + * Begins update for the IotConnector resource. + * + * @return the stage of resource update. + */ + IotConnector.Update update(); + + /** The template for IotConnector update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IotConnector apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IotConnector apply(Context context); + } + /** The IotConnector update stages. */ + interface UpdateStages { + /** The stage of the IotConnector update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the IotConnector update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Setting indicating whether the service has a managed identity associated + * with it.. + * + * @param identity Setting indicating whether the service has a managed identity associated with it. + * @return the next definition stage. + */ + Update withIdentity(ServiceManagedIdentityIdentity identity); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IotConnector refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IotConnector refresh(Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorCollection.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorCollection.java new file mode 100644 index 000000000000..4cfbf6a1acef --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorCollection.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotConnectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of IoT Connectors. */ +@Fluent +public final class IotConnectorCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotConnectorCollection.class); + + /* + * The link used to get the next page of IoT Connectors. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of IoT Connectors. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: The link used to get the next page of IoT Connectors. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of IoT Connectors. + * + * @param nextLink the nextLink value to set. + * @return the IotConnectorCollection object itself. + */ + public IotConnectorCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of IoT Connectors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of IoT Connectors. + * + * @param value the value value to set. + * @return the IotConnectorCollection object itself. + */ + public IotConnectorCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorFhirDestinations.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorFhirDestinations.java new file mode 100644 index 000000000000..ab4abfd86891 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorFhirDestinations.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IotConnectorFhirDestinations. */ +public interface IotConnectorFhirDestinations { + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination. + */ + IotFhirDestination get( + String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName); + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context); + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String iotConnectorName, String fhirDestinationName); + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String workspaceName, + String iotConnectorName, + String fhirDestinationName, + Context context); + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination along with {@link Response}. + */ + IotFhirDestination getById(String id); + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Iot Connector FHIR destination along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an IoT Connector FHIR destination. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IotFhirDestination resource. + * + * @param name resource name. + * @return the first stage of the new IotFhirDestination definition. + */ + IotFhirDestination.DefinitionStages.Blank define(String name); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorPatchResource.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorPatchResource.java new file mode 100644 index 000000000000..9f5ea9bdf72d --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectorPatchResource.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Iot Connector patch properties. */ +@Fluent +public final class IotConnectorPatchResource extends ResourceTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotConnectorPatchResource.class); + + /* + * Setting indicating whether the service has a managed identity associated + * with it. + */ + @JsonProperty(value = "identity") + private ServiceManagedIdentityIdentity identity; + + /** + * Get the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + public ServiceManagedIdentityIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @param identity the identity value to set. + * @return the IotConnectorPatchResource object itself. + */ + public IotConnectorPatchResource withIdentity(ServiceManagedIdentityIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public IotConnectorPatchResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectors.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectors.java new file mode 100644 index 000000000000..bc9c5a4069ae --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnectors.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IotConnectors. */ +public interface IotConnectors { + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors as paginated response with {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Lists all IoT Connectors for the given workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of IoT Connectors as paginated response with {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the properties of the specified IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector. + */ + IotConnector get(String resourceGroupName, String workspaceName, String iotConnectorName); + + /** + * Gets the properties of the specified IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String iotConnectorName, Context context); + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String iotConnectorName, String workspaceName); + + /** + * Deletes an IoT Connector. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String iotConnectorName, String workspaceName, Context context); + + /** + * Gets the properties of the specified IoT Connector. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector along with {@link Response}. + */ + IotConnector getById(String id); + + /** + * Gets the properties of the specified IoT Connector. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified IoT Connector along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an IoT Connector. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an IoT Connector. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IotConnector resource. + * + * @param name resource name. + * @return the first stage of the new IotConnector definition. + */ + IotConnector.DefinitionStages.Blank define(String name); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotDestinationProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotDestinationProperties.java new file mode 100644 index 000000000000..8e23766ba64d --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotDestinationProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common IoT Connector destination properties. */ +@Immutable +public class IotDestinationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotDestinationProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotEventHubIngestionEndpointConfiguration.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotEventHubIngestionEndpointConfiguration.java new file mode 100644 index 000000000000..605a4a6bafb2 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotEventHubIngestionEndpointConfiguration.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Event Hub ingestion endpoint configuration. */ +@Fluent +public final class IotEventHubIngestionEndpointConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotEventHubIngestionEndpointConfiguration.class); + + /* + * Event Hub name to connect to. + */ + @JsonProperty(value = "eventHubName") + private String eventHubName; + + /* + * Consumer group of the event hub to connected to. + */ + @JsonProperty(value = "consumerGroup") + private String consumerGroup; + + /* + * Fully qualified namespace of the Event Hub to connect to. + */ + @JsonProperty(value = "fullyQualifiedEventHubNamespace") + private String fullyQualifiedEventHubNamespace; + + /** + * Get the eventHubName property: Event Hub name to connect to. + * + * @return the eventHubName value. + */ + public String eventHubName() { + return this.eventHubName; + } + + /** + * Set the eventHubName property: Event Hub name to connect to. + * + * @param eventHubName the eventHubName value to set. + * @return the IotEventHubIngestionEndpointConfiguration object itself. + */ + public IotEventHubIngestionEndpointConfiguration withEventHubName(String eventHubName) { + this.eventHubName = eventHubName; + return this; + } + + /** + * Get the consumerGroup property: Consumer group of the event hub to connected to. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: Consumer group of the event hub to connected to. + * + * @param consumerGroup the consumerGroup value to set. + * @return the IotEventHubIngestionEndpointConfiguration object itself. + */ + public IotEventHubIngestionEndpointConfiguration withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the fullyQualifiedEventHubNamespace property: Fully qualified namespace of the Event Hub to connect to. + * + * @return the fullyQualifiedEventHubNamespace value. + */ + public String fullyQualifiedEventHubNamespace() { + return this.fullyQualifiedEventHubNamespace; + } + + /** + * Set the fullyQualifiedEventHubNamespace property: Fully qualified namespace of the Event Hub to connect to. + * + * @param fullyQualifiedEventHubNamespace the fullyQualifiedEventHubNamespace value to set. + * @return the IotEventHubIngestionEndpointConfiguration object itself. + */ + public IotEventHubIngestionEndpointConfiguration withFullyQualifiedEventHubNamespace( + String fullyQualifiedEventHubNamespace) { + this.fullyQualifiedEventHubNamespace = fullyQualifiedEventHubNamespace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotFhirDestination.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotFhirDestination.java new file mode 100644 index 000000000000..87ab6a66e196 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotFhirDestination.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner; + +/** An immutable client-side representation of IotFhirDestination. */ +public interface IotFhirDestination { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: An etag associated with the resource, used for optimistic concurrency when editing it. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the location property: The resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the resourceIdentityResolutionType property: Determines how resource identity is resolved on the + * destination. + * + * @return the resourceIdentityResolutionType value. + */ + IotIdentityResolutionType resourceIdentityResolutionType(); + + /** + * Gets the fhirServiceResourceId property: Fully qualified resource id of the FHIR service to connect to. + * + * @return the fhirServiceResourceId value. + */ + String fhirServiceResourceId(); + + /** + * Gets the fhirMapping property: FHIR Mappings. + * + * @return the fhirMapping value. + */ + IotMappingProperties fhirMapping(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner object. + * + * @return the inner object. + */ + IotFhirDestinationInner innerModel(); + + /** The entirety of the IotFhirDestination definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithResourceIdentityResolutionType, + DefinitionStages.WithFhirServiceResourceId, + DefinitionStages.WithFhirMapping, + DefinitionStages.WithCreate { + } + /** The IotFhirDestination definition stages. */ + interface DefinitionStages { + /** The first stage of the IotFhirDestination definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IotFhirDestination definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, iotConnectorName. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @return the next definition stage. + */ + WithResourceIdentityResolutionType withExistingIotconnector( + String resourceGroupName, String workspaceName, String iotConnectorName); + } + /** The stage of the IotFhirDestination definition allowing to specify resourceIdentityResolutionType. */ + interface WithResourceIdentityResolutionType { + /** + * Specifies the resourceIdentityResolutionType property: Determines how resource identity is resolved on + * the destination.. + * + * @param resourceIdentityResolutionType Determines how resource identity is resolved on the destination. + * @return the next definition stage. + */ + WithFhirServiceResourceId withResourceIdentityResolutionType( + IotIdentityResolutionType resourceIdentityResolutionType); + } + /** The stage of the IotFhirDestination definition allowing to specify fhirServiceResourceId. */ + interface WithFhirServiceResourceId { + /** + * Specifies the fhirServiceResourceId property: Fully qualified resource id of the FHIR service to connect + * to.. + * + * @param fhirServiceResourceId Fully qualified resource id of the FHIR service to connect to. + * @return the next definition stage. + */ + WithFhirMapping withFhirServiceResourceId(String fhirServiceResourceId); + } + /** The stage of the IotFhirDestination definition allowing to specify fhirMapping. */ + interface WithFhirMapping { + /** + * Specifies the fhirMapping property: FHIR Mappings. + * + * @param fhirMapping FHIR Mappings. + * @return the next definition stage. + */ + WithCreate withFhirMapping(IotMappingProperties fhirMapping); + } + /** + * The stage of the IotFhirDestination definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithEtag { + /** + * Executes the create request. + * + * @return the created resource. + */ + IotFhirDestination create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IotFhirDestination create(Context context); + } + /** The stage of the IotFhirDestination definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the IotFhirDestination definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: An etag associated with the resource, used for optimistic concurrency when + * editing it.. + * + * @param etag An etag associated with the resource, used for optimistic concurrency when editing it. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + } + /** + * Begins update for the IotFhirDestination resource. + * + * @return the stage of resource update. + */ + IotFhirDestination.Update update(); + + /** The template for IotFhirDestination update. */ + interface Update + extends UpdateStages.WithEtag, + UpdateStages.WithResourceIdentityResolutionType, + UpdateStages.WithFhirServiceResourceId, + UpdateStages.WithFhirMapping { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IotFhirDestination apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IotFhirDestination apply(Context context); + } + /** The IotFhirDestination update stages. */ + interface UpdateStages { + /** The stage of the IotFhirDestination update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: An etag associated with the resource, used for optimistic concurrency when + * editing it.. + * + * @param etag An etag associated with the resource, used for optimistic concurrency when editing it. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the IotFhirDestination update allowing to specify resourceIdentityResolutionType. */ + interface WithResourceIdentityResolutionType { + /** + * Specifies the resourceIdentityResolutionType property: Determines how resource identity is resolved on + * the destination.. + * + * @param resourceIdentityResolutionType Determines how resource identity is resolved on the destination. + * @return the next definition stage. + */ + Update withResourceIdentityResolutionType(IotIdentityResolutionType resourceIdentityResolutionType); + } + /** The stage of the IotFhirDestination update allowing to specify fhirServiceResourceId. */ + interface WithFhirServiceResourceId { + /** + * Specifies the fhirServiceResourceId property: Fully qualified resource id of the FHIR service to connect + * to.. + * + * @param fhirServiceResourceId Fully qualified resource id of the FHIR service to connect to. + * @return the next definition stage. + */ + Update withFhirServiceResourceId(String fhirServiceResourceId); + } + /** The stage of the IotFhirDestination update allowing to specify fhirMapping. */ + interface WithFhirMapping { + /** + * Specifies the fhirMapping property: FHIR Mappings. + * + * @param fhirMapping FHIR Mappings. + * @return the next definition stage. + */ + Update withFhirMapping(IotMappingProperties fhirMapping); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IotFhirDestination refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IotFhirDestination refresh(Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotFhirDestinationCollection.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotFhirDestinationCollection.java new file mode 100644 index 000000000000..c441f27acb36 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotFhirDestinationCollection.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.models.IotFhirDestinationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of IoT Connector FHIR destinations. */ +@Fluent +public final class IotFhirDestinationCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotFhirDestinationCollection.class); + + /* + * The link used to get the next page of IoT FHIR destinations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of IoT Connector FHIR destinations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: The link used to get the next page of IoT FHIR destinations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of IoT FHIR destinations. + * + * @param nextLink the nextLink value to set. + * @return the IotFhirDestinationCollection object itself. + */ + public IotFhirDestinationCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of IoT Connector FHIR destinations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of IoT Connector FHIR destinations. + * + * @param value the value value to set. + * @return the IotFhirDestinationCollection object itself. + */ + public IotFhirDestinationCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotIdentityResolutionType.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotIdentityResolutionType.java new file mode 100644 index 000000000000..a99f43d7bcc8 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotIdentityResolutionType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IotIdentityResolutionType. */ +public final class IotIdentityResolutionType extends ExpandableStringEnum { + /** Static value Create for IotIdentityResolutionType. */ + public static final IotIdentityResolutionType CREATE = fromString("Create"); + + /** Static value Lookup for IotIdentityResolutionType. */ + public static final IotIdentityResolutionType LOOKUP = fromString("Lookup"); + + /** + * Creates or finds a IotIdentityResolutionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IotIdentityResolutionType. + */ + @JsonCreator + public static IotIdentityResolutionType fromString(String name) { + return fromString(name, IotIdentityResolutionType.class); + } + + /** @return known IotIdentityResolutionType values. */ + public static Collection values() { + return values(IotIdentityResolutionType.class); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotMappingProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotMappingProperties.java new file mode 100644 index 000000000000..4c7d205fda08 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotMappingProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The mapping content. */ +@Fluent +public final class IotMappingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotMappingProperties.class); + + /* + * The mapping. + */ + @JsonProperty(value = "content") + private Object content; + + /** + * Get the content property: The mapping. + * + * @return the content value. + */ + public Object content() { + return this.content; + } + + /** + * Set the content property: The mapping. + * + * @param content the content value to set. + * @return the IotMappingProperties object itself. + */ + public IotMappingProperties withContent(Object content) { + this.content = content; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationListResult.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ListOperations.java similarity index 59% rename from sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationListResult.java rename to sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ListOperations.java index a9d42126eb6e..14f405d745ad 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationListResult.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ListOperations.java @@ -6,31 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.healthcareapis.fluent.models.OperationInner; +import com.azure.resourcemanager.healthcareapis.fluent.models.OperationDetailInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of service operations. It contains a list of operations and a URL link to get the next set of results. */ +/** Available operations of the service. */ @Fluent -public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); +public final class ListOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListOperations.class); /* - * The link used to get the next page of service description objects. + * Collection of available operation details + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. */ @JsonProperty(value = "nextLink") private String nextLink; - /* - * A list of service operations supported by the Microsoft.HealthcareApis - * resource provider. + /** + * Get the value property: Collection of available operation details. + * + * @return the value value. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + public List value() { + return this.value; + } /** - * Get the nextLink property: The link used to get the next page of service description objects. + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. * * @return the nextLink value. */ @@ -39,25 +49,17 @@ public String nextLink() { } /** - * Set the nextLink property: The link used to get the next page of service description objects. + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. * * @param nextLink the nextLink value to set. - * @return the OperationListResult object itself. + * @return the ListOperations object itself. */ - public OperationListResult withNextLink(String nextLink) { + public ListOperations withNextLink(String nextLink) { this.nextLink = nextLink; return this; } - /** - * Get the value property: A list of service operations supported by the Microsoft.HealthcareApis resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - /** * Validates the instance. * diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/LocationBasedResource.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/LocationBasedResource.java new file mode 100644 index 000000000000..9c120f7b1cd5 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/LocationBasedResource.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The common properties for any location based resource, tracked or proxy. */ +@Fluent +public class LocationBasedResource extends ResourceCore { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationBasedResource.class); + + /* + * The resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the location property: The resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The resource location. + * + * @param location the location value to set. + * @return the LocationBasedResource object itself. + */ + public LocationBasedResource withLocation(String location) { + this.location = location; + return this; + } + + /** {@inheritDoc} */ + @Override + public LocationBasedResource withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/LogSpecification.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/LogSpecification.java new file mode 100644 index 000000000000..cb870eb80ebc --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/LogSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Log for Azure Monitoring. */ +@Fluent +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * Name of the log + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the log + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Blob duration of the log + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: Name of the log. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the log. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the log. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the log. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Blob duration of the log. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Blob duration of the log. + * + * @param blobDuration the blobDuration value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/MetricDimension.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/MetricDimension.java new file mode 100644 index 000000000000..ff764bc1954e --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/MetricDimension.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Dimension of metrics. */ +@Fluent +public final class MetricDimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDimension.class); + + /* + * Name of the dimension + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the dimension + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Whether this dimension should be included for the Shoebox export + * scenario + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** + * Get the name property: Name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the dimension. + * + * @param name the name value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the dimension. + * + * @param displayName the displayName value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the toBeExportedForShoebox property: Whether this dimension should be included for the Shoebox export + * scenario. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set the toBeExportedForShoebox property: Whether this dimension should be included for the Shoebox export + * scenario. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/MetricSpecification.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/MetricSpecification.java new file mode 100644 index 000000000000..1ca96240036d --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/MetricSpecification.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifications of the Metrics for Azure Monitoring. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * Name of the metric + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the metric + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Localized friendly description of the metric + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Unit that makes sense for the metric + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Name of the metric category that the metric belongs to. A metric can + * only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /* + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Supported aggregation types + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /* + * Supported time grain types + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /* + * Optional. If set to true, then zero will be returned for time duration + * where no metric is emitted/published. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Dimensions of the metric + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Name of the MDM namespace. Optional. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /** + * Get the name property: Name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the metric. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the metric. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Localized friendly description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Unit that makes sense for the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Unit that makes sense for the metric. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @param category the category value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the supportedAggregationTypes property: Supported aggregation types. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: Supported aggregation types. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: Supported time grain types. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: Supported time grain types. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the dimensions property: Dimensions of the metric. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Dimensions of the metric. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the sourceMdmNamespace property: Name of the MDM namespace. Optional. + * + * @return the sourceMdmNamespace value. + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the sourceMdmNamespace property: Name of the MDM namespace. Optional. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operation.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operation.java deleted file mode 100644 index 01e3c6772951..000000000000 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operation.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.healthcareapis.models; - -import com.azure.resourcemanager.healthcareapis.fluent.models.OperationInner; - -/** An immutable client-side representation of Operation. */ -public interface Operation { - /** - * Gets the name property: Operation name: {provider}/{resource}/{read | write | action | delete}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the origin property: Default value is 'user,system'. - * - * @return the origin value. - */ - String origin(); - - /** - * Gets the display property: The information displayed about the operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.healthcareapis.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationDetail.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationDetail.java new file mode 100644 index 000000000000..b2a08b8afcee --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationDetail.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.resourcemanager.healthcareapis.fluent.models.OperationDetailInner; + +/** An immutable client-side representation of OperationDetail. */ +public interface OperationDetail { + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Display of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Default value is 'user,system'. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the properties property: Properties of the operation. + * + * @return the properties value. + */ + OperationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.healthcareapis.fluent.models.OperationDetailInner object. + * + * @return the inner object. + */ + OperationDetailInner innerModel(); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationProperties.java new file mode 100644 index 000000000000..4641f05dde0b --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extra Operation properties. */ +@Fluent +public final class OperationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationProperties.class); + + /* + * Service specifications of the operation + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: Service specifications of the operation. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Service specifications of the operation. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationResults.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationResults.java index 6830494fc896..60389a4dda48 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationResults.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationResults.java @@ -30,7 +30,7 @@ public interface OperationResults { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result for a long running operation. + * @return the operation result for a long running operation along with {@link Response}. */ Response getWithResponse( String locationName, String operationResultId, Context context); diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationResultsDescription.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationResultsDescription.java index 169d75927d5a..16d712036023 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationResultsDescription.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationResultsDescription.java @@ -36,6 +36,13 @@ public interface OperationResultsDescription { */ String startTime(); + /** + * Gets the endTime property: The time that the operation finished. + * + * @return the endTime value. + */ + String endTime(); + /** * Gets the properties property: Additional properties of the operation result. * diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operations.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operations.java index 189739bf548a..0bf0c87cd21e 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operations.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operations.java @@ -10,22 +10,22 @@ /** Resource collection API of Operations. */ public interface Operations { /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Lists all of the available Healthcare service REST API operations. + * Lists all of the available operations supported by Microsoft Healthcare resource provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of service operations. + * @return available operations of the service as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnection.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnection.java index ee92c7cfb92e..b01d379587b1 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnection.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnection.java @@ -5,36 +5,31 @@ package com.azure.resourcemanager.healthcareapis.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateEndpointConnectionProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Private Endpoint Connection resource. */ -@JsonFlatten @Fluent public class PrivateEndpointConnection extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnection.class); /* - * The resource of private end point. + * Resource properties. */ - @JsonProperty(value = "properties.privateEndpoint") - private PrivateEndpoint privateEndpoint; + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; - /* - * A collection of information about the state of the connection between - * service consumer and provider. - */ - @JsonProperty(value = "properties.privateLinkServiceConnectionState") - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * The provisioning state of the private endpoint connection resource. + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointConnectionProvisioningState provisioningState; + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } /** * Get the privateEndpoint property: The resource of private end point. @@ -42,7 +37,7 @@ public class PrivateEndpointConnection extends ProxyResource { * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); } /** @@ -52,7 +47,10 @@ public PrivateEndpoint privateEndpoint() { * @return the PrivateEndpointConnection object itself. */ public PrivateEndpointConnection withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); return this; } @@ -63,7 +61,7 @@ public PrivateEndpointConnection withPrivateEndpoint(PrivateEndpoint privateEndp * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); } /** @@ -75,7 +73,10 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { */ public PrivateEndpointConnection withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); return this; } @@ -85,7 +86,7 @@ public PrivateEndpointConnection withPrivateLinkServiceConnectionState( * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -94,11 +95,8 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnectionDescription.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnectionDescription.java index 3fc2b9e27847..ebe028cae92f 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnectionDescription.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnectionDescription.java @@ -54,7 +54,7 @@ public interface PrivateEndpointConnectionDescription { PrivateEndpointConnectionProvisioningState provisioningState(); /** - * Gets the systemData property: System metadata for this resource. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * * @return the systemData value. */ diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnections.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnections.java index c2522f428026..fb427bdfdc96 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnections.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateEndpointConnections.java @@ -18,7 +18,8 @@ public interface PrivateEndpointConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ PagedIterable listByService(String resourceGroupName, String resourceName); @@ -31,7 +32,8 @@ public interface PrivateEndpointConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ PagedIterable listByService( String resourceGroupName, String resourceName, Context context); @@ -62,7 +64,7 @@ PrivateEndpointConnectionDescription get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the service. + * @return the specified private endpoint connection associated with the service along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); @@ -101,7 +103,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the service. + * @return the specified private endpoint connection associated with the service along with {@link Response}. */ PrivateEndpointConnectionDescription getById(String id); @@ -113,7 +115,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the service. + * @return the specified private endpoint connection associated with the service along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResource.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResource.java index 351906f7140e..0ea0d8668a10 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResource.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResource.java @@ -5,36 +5,32 @@ package com.azure.resourcemanager.healthcareapis.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateLinkResourceProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A private link resource. */ -@JsonFlatten @Fluent public class PrivateLinkResource extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); /* - * The private link resource group id. + * Resource properties. */ - @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) - private String groupId; + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; - /* - * The private link resource required member names. - */ - @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) - private List requiredMembers; - - /* - * The private link resource Private link DNS zone name. + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.requiredZoneNames") - private List requiredZoneNames; + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } /** * Get the groupId property: The private link resource group id. @@ -42,7 +38,7 @@ public class PrivateLinkResource extends ProxyResource { * @return the groupId value. */ public String groupId() { - return this.groupId; + return this.innerProperties() == null ? null : this.innerProperties().groupId(); } /** @@ -51,7 +47,7 @@ public String groupId() { * @return the requiredMembers value. */ public List requiredMembers() { - return this.requiredMembers; + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); } /** @@ -60,7 +56,7 @@ public List requiredMembers() { * @return the requiredZoneNames value. */ public List requiredZoneNames() { - return this.requiredZoneNames; + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); } /** @@ -70,7 +66,10 @@ public List requiredZoneNames() { * @return the PrivateLinkResource object itself. */ public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); return this; } @@ -80,5 +79,8 @@ public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResourceDescription.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResourceDescription.java index f0d4e1f0d132..734dd0fe7569 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResourceDescription.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResourceDescription.java @@ -53,7 +53,7 @@ public interface PrivateLinkResourceDescription { List requiredZoneNames(); /** - * Gets the systemData property: System metadata for this resource. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * * @return the systemData value. */ diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResources.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResources.java index 8d7c8c02ecbe..5b6ea64b3072 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResources.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResources.java @@ -30,7 +30,7 @@ public interface PrivateLinkResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a service. + * @return the private link resources that need to be created for a service along with {@link Response}. */ Response listByServiceWithResponse( String resourceGroupName, String resourceName, Context context); @@ -58,7 +58,7 @@ Response listByServiceWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource that need to be created for a service. + * @return a private link resource that need to be created for a service along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String resourceName, String groupName, Context context); diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ProvisioningState.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ProvisioningState.java index 525376c8037d..6ed103cab9ee 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ProvisioningState.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ProvisioningState.java @@ -37,6 +37,18 @@ public final class ProvisioningState extends ExpandableStringEnum tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ResourceTags object itself. + */ + public ResourceTags withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ResourceVersionPolicyConfiguration.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ResourceVersionPolicyConfiguration.java new file mode 100644 index 000000000000..eaf9f0f11639 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ResourceVersionPolicyConfiguration.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The settings for history tracking for FHIR resources. */ +@Fluent +public final class ResourceVersionPolicyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceVersionPolicyConfiguration.class); + + /* + * The default value for tracking history across all resources. + */ + @JsonProperty(value = "default") + private FhirResourceVersionPolicy defaultProperty; + + /* + * A list of FHIR Resources and their version policy overrides. + */ + @JsonProperty(value = "resourceTypeOverrides") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map resourceTypeOverrides; + + /** + * Get the defaultProperty property: The default value for tracking history across all resources. + * + * @return the defaultProperty value. + */ + public FhirResourceVersionPolicy defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: The default value for tracking history across all resources. + * + * @param defaultProperty the defaultProperty value to set. + * @return the ResourceVersionPolicyConfiguration object itself. + */ + public ResourceVersionPolicyConfiguration withDefaultProperty(FhirResourceVersionPolicy defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the resourceTypeOverrides property: A list of FHIR Resources and their version policy overrides. + * + * @return the resourceTypeOverrides value. + */ + public Map resourceTypeOverrides() { + return this.resourceTypeOverrides; + } + + /** + * Set the resourceTypeOverrides property: A list of FHIR Resources and their version policy overrides. + * + * @param resourceTypeOverrides the resourceTypeOverrides value to set. + * @return the ResourceVersionPolicyConfiguration object itself. + */ + public ResourceVersionPolicyConfiguration withResourceTypeOverrides( + Map resourceTypeOverrides) { + this.resourceTypeOverrides = resourceTypeOverrides; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceAcrConfigurationInfo.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceAcrConfigurationInfo.java index 8bf5fe8a9614..6907a9d1a02a 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceAcrConfigurationInfo.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceAcrConfigurationInfo.java @@ -21,6 +21,12 @@ public final class ServiceAcrConfigurationInfo { @JsonProperty(value = "loginServers") private List loginServers; + /* + * The list of Open Container Initiative (OCI) artifacts. + */ + @JsonProperty(value = "ociArtifacts") + private List ociArtifacts; + /** * Get the loginServers property: The list of the ACR login servers. * @@ -41,11 +47,34 @@ public ServiceAcrConfigurationInfo withLoginServers(List loginServers) { return this; } + /** + * Get the ociArtifacts property: The list of Open Container Initiative (OCI) artifacts. + * + * @return the ociArtifacts value. + */ + public List ociArtifacts() { + return this.ociArtifacts; + } + + /** + * Set the ociArtifacts property: The list of Open Container Initiative (OCI) artifacts. + * + * @param ociArtifacts the ociArtifacts value to set. + * @return the ServiceAcrConfigurationInfo object itself. + */ + public ServiceAcrConfigurationInfo withOciArtifacts(List ociArtifacts) { + this.ociArtifacts = ociArtifacts; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (ociArtifacts() != null) { + ociArtifacts().forEach(e -> e.validate()); + } } } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceEventState.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceEventState.java new file mode 100644 index 000000000000..7a755582cf26 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceEventState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceEventState. */ +public final class ServiceEventState extends ExpandableStringEnum { + /** Static value Disabled for ServiceEventState. */ + public static final ServiceEventState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ServiceEventState. */ + public static final ServiceEventState ENABLED = fromString("Enabled"); + + /** Static value Updating for ServiceEventState. */ + public static final ServiceEventState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ServiceEventState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceEventState. + */ + @JsonCreator + public static ServiceEventState fromString(String name) { + return fromString(name, ServiceEventState.class); + } + + /** @return known ServiceEventState values. */ + public static Collection values() { + return values(ServiceEventState.class); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentity.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentity.java new file mode 100644 index 000000000000..658fe9377a5e --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentity.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public class ServiceManagedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceManagedIdentity.class); + + /* + * Setting indicating whether the service has a managed identity associated + * with it. + */ + @JsonProperty(value = "identity") + private ServiceManagedIdentityIdentity identity; + + /** + * Get the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @return the identity value. + */ + public ServiceManagedIdentityIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Setting indicating whether the service has a managed identity associated with it. + * + * @param identity the identity value to set. + * @return the ServiceManagedIdentity object itself. + */ + public ServiceManagedIdentity withIdentity(ServiceManagedIdentityIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentityIdentity.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentityIdentity.java new file mode 100644 index 000000000000..b75d014527b6 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentityIdentity.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Setting indicating whether the service has a managed identity associated with it. */ +@Fluent +public class ServiceManagedIdentityIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceManagedIdentityIdentity.class); + + /* + * Type of identity being specified, currently SystemAssigned and None are + * allowed. + */ + @JsonProperty(value = "type", required = true) + private ServiceManagedIdentityType type; + + /* + * The service principal ID of the system assigned identity. This property + * will only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * 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. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the type property: Type of identity being specified, currently SystemAssigned and None are allowed. + * + * @return the type value. + */ + public ServiceManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of identity being specified, currently SystemAssigned and None are allowed. + * + * @param type the type value to set. + * @return the ServiceManagedIdentityIdentity object itself. + */ + public ServiceManagedIdentityIdentity withType(ServiceManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the userAssignedIdentities property: 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. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: 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. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ServiceManagedIdentityIdentity object itself. + */ + public ServiceManagedIdentityIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model ServiceManagedIdentityIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentityType.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentityType.java new file mode 100644 index 000000000000..5967c1e1c937 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentityType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceManagedIdentityType. */ +public final class ServiceManagedIdentityType extends ExpandableStringEnum { + /** Static value None for ServiceManagedIdentityType. */ + public static final ServiceManagedIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ServiceManagedIdentityType. */ + public static final ServiceManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ServiceManagedIdentityType. */ + public static final ServiceManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned,UserAssigned for ServiceManagedIdentityType. */ + public static final ServiceManagedIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned,UserAssigned"); + + /** + * Creates or finds a ServiceManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceManagedIdentityType. + */ + @JsonCreator + public static ServiceManagedIdentityType fromString(String name) { + return fromString(name, ServiceManagedIdentityType.class); + } + + /** @return known ServiceManagedIdentityType values. */ + public static Collection values() { + return values(ServiceManagedIdentityType.class); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceOciArtifactEntry.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceOciArtifactEntry.java new file mode 100644 index 000000000000..8d8b59affc55 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceOciArtifactEntry.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An Open Container Initiative (OCI) artifact. */ +@Fluent +public final class ServiceOciArtifactEntry { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceOciArtifactEntry.class); + + /* + * The Azure Container Registry login server. + */ + @JsonProperty(value = "loginServer") + private String loginServer; + + /* + * The artifact name. + */ + @JsonProperty(value = "imageName") + private String imageName; + + /* + * The artifact digest. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * Get the loginServer property: The Azure Container Registry login server. + * + * @return the loginServer value. + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Set the loginServer property: The Azure Container Registry login server. + * + * @param loginServer the loginServer value to set. + * @return the ServiceOciArtifactEntry object itself. + */ + public ServiceOciArtifactEntry withLoginServer(String loginServer) { + this.loginServer = loginServer; + return this; + } + + /** + * Get the imageName property: The artifact name. + * + * @return the imageName value. + */ + public String imageName() { + return this.imageName; + } + + /** + * Set the imageName property: The artifact name. + * + * @param imageName the imageName value to set. + * @return the ServiceOciArtifactEntry object itself. + */ + public ServiceOciArtifactEntry withImageName(String imageName) { + this.imageName = imageName; + return this; + } + + /** + * Get the digest property: The artifact digest. + * + * @return the digest value. + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest property: The artifact digest. + * + * @param digest the digest value to set. + * @return the ServiceOciArtifactEntry object itself. + */ + public ServiceOciArtifactEntry withDigest(String digest) { + this.digest = digest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceSpecification.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceSpecification.java new file mode 100644 index 000000000000..59be74534f61 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service specification payload. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * Specifications of the Log for Azure Monitoring + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /* + * Specifications of the Metrics for Azure Monitoring + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Services.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Services.java index 90cad71effcb..7922cf35e270 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Services.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Services.java @@ -31,7 +31,7 @@ public interface Services { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of a service instance. + * @return the metadata of a service instance along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String resourceName, Context context); @@ -64,7 +64,7 @@ Response getByResourceGroupWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -75,7 +75,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a subscription. + * @return all the service instances in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -86,7 +86,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -98,7 +98,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the service instances in a resource group. + * @return all the service instances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -123,7 +123,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given service name is available. + * @return the properties indicating whether a given service name is available along with {@link Response}. */ Response checkNameAvailabilityWithResponse( CheckNameAvailabilityParameters checkNameAvailabilityInputs, Context context); @@ -135,7 +135,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of a service instance. + * @return the metadata of a service instance along with {@link Response}. */ ServicesDescription getById(String id); @@ -147,7 +147,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of a service instance. + * @return the metadata of a service instance along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServicesPatchDescription.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServicesPatchDescription.java index 8ebaa4021061..58130fcf99a4 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServicesPatchDescription.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServicesPatchDescription.java @@ -5,30 +5,30 @@ package com.azure.resourcemanager.healthcareapis.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.models.ServicesPropertiesUpdateParameters; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The description of the service. */ -@JsonFlatten @Fluent -public class ServicesPatchDescription { +public final class ServicesPatchDescription { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesPatchDescription.class); /* * Instance tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* - * Control permission for data plane traffic coming from public networks - * while private endpoint is enabled. + * The properties for updating a service instance. */ - @JsonProperty(value = "properties.publicNetworkAccess") - private PublicNetworkAccess publicNetworkAccess; + @JsonProperty(value = "properties") + private ServicesPropertiesUpdateParameters innerProperties; /** * Get the tags property: Instance tags. @@ -50,6 +50,15 @@ public ServicesPatchDescription withTags(Map tags) { return this; } + /** + * Get the innerProperties property: The properties for updating a service instance. + * + * @return the innerProperties value. + */ + private ServicesPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + /** * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. @@ -57,7 +66,7 @@ public ServicesPatchDescription withTags(Map tags) { * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); } /** @@ -68,7 +77,10 @@ public PublicNetworkAccess publicNetworkAccess() { * @return the ServicesPatchDescription object itself. */ public ServicesPatchDescription withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; + if (this.innerProperties() == null) { + this.innerProperties = new ServicesPropertiesUpdateParameters(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); return this; } @@ -78,5 +90,8 @@ public ServicesPatchDescription withPublicNetworkAccess(PublicNetworkAccess publ * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/TaggedResource.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/TaggedResource.java new file mode 100644 index 000000000000..e96a962768fa --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/TaggedResource.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The common properties of tracked resources in the service. */ +@Fluent +public class TaggedResource extends LocationBasedResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaggedResource.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TaggedResource object itself. + */ + public TaggedResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** {@inheritDoc} */ + @Override + public TaggedResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public TaggedResource withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/UserAssignedIdentity.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..7a1483438c00 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public class UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); + + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspace.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspace.java new file mode 100644 index 000000000000..134915af23d8 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspace.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.WorkspaceInner; +import java.util.Map; + +/** An immutable client-side representation of Workspace. */ +public interface Workspace { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: An etag associated with the resource, used for optimistic concurrency when editing it. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the location property: The resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Workspaces resource specific properties. + * + * @return the properties value. + */ + WorkspaceProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.healthcareapis.fluent.models.WorkspaceInner object. + * + * @return the inner object. + */ + WorkspaceInner innerModel(); + + /** The entirety of the Workspace definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + /** The Workspace definition stages. */ + interface DefinitionStages { + /** The first stage of the Workspace definition. */ + interface Blank extends WithResourceGroup { + } + /** The stage of the Workspace definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Workspace definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithTags, + DefinitionStages.WithEtag, + DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Workspace create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Workspace create(Context context); + } + /** The stage of the Workspace definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the Workspace definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Workspace definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: An etag associated with the resource, used for optimistic concurrency when + * editing it.. + * + * @param etag An etag associated with the resource, used for optimistic concurrency when editing it. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the Workspace definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Workspaces resource specific properties.. + * + * @param properties Workspaces resource specific properties. + * @return the next definition stage. + */ + WithCreate withProperties(WorkspaceProperties properties); + } + } + /** + * Begins update for the Workspace resource. + * + * @return the stage of resource update. + */ + Workspace.Update update(); + + /** The template for Workspace update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Workspace apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Workspace apply(Context context); + } + /** The Workspace update stages. */ + interface UpdateStages { + /** The stage of the Workspace update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Workspace refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Workspace refresh(Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceList.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceList.java new file mode 100644 index 000000000000..c5e0e28f2d10 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.healthcareapis.fluent.models.WorkspaceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of workspace object with a next link. */ +@Fluent +public final class WorkspaceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceList.class); + + /* + * The link used to get the next page. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Collection of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: The link used to get the next page. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page. + * + * @param nextLink the nextLink value to set. + * @return the WorkspaceList object itself. + */ + public WorkspaceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the WorkspaceList object itself. + */ + public WorkspaceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePatchResource.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePatchResource.java new file mode 100644 index 000000000000..65b82b7e1851 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePatchResource.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** Workspace patch properties. */ +@Fluent +public final class WorkspacePatchResource extends ResourceTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspacePatchResource.class); + + /** {@inheritDoc} */ + @Override + public WorkspacePatchResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePrivateEndpointConnections.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePrivateEndpointConnections.java new file mode 100644 index 000000000000..ddb00cf86efa --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePrivateEndpointConnections.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateEndpointConnectionDescriptionInner; + +/** Resource collection API of WorkspacePrivateEndpointConnections. */ +public interface WorkspacePrivateEndpointConnections { + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Lists all private endpoint connections for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the workspace. + */ + PrivateEndpointConnectionDescription get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the workspace along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + PrivateEndpointConnectionDescription createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties); + + /** + * Update the state of the specified private endpoint connection associated with the workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + PrivateEndpointConnectionDescription createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionDescriptionInner properties, + Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePrivateLinkResources.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePrivateLinkResources.java new file mode 100644 index 000000000000..1f3877d9f4fb --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspacePrivateLinkResources.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WorkspacePrivateLinkResources. */ +public interface WorkspacePrivateLinkResources { + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Gets the private link resources that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a workspace as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a private link resource that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param groupName The name of the private link resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource that need to be created for a workspace. + */ + PrivateLinkResourceDescription get(String resourceGroupName, String workspaceName, String groupName); + + /** + * Gets a private link resource that need to be created for a workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param groupName The name of the private link resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource that need to be created for a workspace along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String groupName, Context context); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceProperties.java new file mode 100644 index 000000000000..cd61bf23a9db --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Workspaces resource specific properties. */ +@Fluent +public final class WorkspaceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The list of private endpoint connections that are set up for this + * resource. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpointConnections property: The list of private endpoint connections that are set up for this + * resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspaces.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspaces.java new file mode 100644 index 000000000000..4ac1c6107c52 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspaces.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Workspaces. */ +public interface Workspaces { + /** + * Lists all the available workspaces under the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the available workspaces under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the available workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workspace object with a next link as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the properties of the specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace. + */ + Workspace getByResourceGroup(String resourceGroupName, String workspaceName); + + /** + * Gets the properties of the specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String workspaceName); + + /** + * Deletes a specified workspace. + * + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets the properties of the specified workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace along with {@link Response}. + */ + Workspace getById(String id); + + /** + * Gets the properties of the specified workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified workspace along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a specified workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a specified workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Workspace resource. + * + * @param name resource name. + * @return the first stage of the new Workspace definition. + */ + Workspace.DefinitionStages.Blank define(String name); +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesCreateOrUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..6fa055adff1a --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesCreateOrUpdateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +/** Samples for DicomServices CreateOrUpdate. */ +public final class DicomServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Create.json + */ + /** + * Sample code: Create or update a Dicom Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateADicomService( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .dicomServices() + .define("blue") + .withExistingWorkspace("testRG", "workspace1") + .withRegion("westus") + .create(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesDeleteSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesDeleteSamples.java new file mode 100644 index 000000000000..e679789fb4ab --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for DicomServices Delete. */ +public final class DicomServicesDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Delete.json + */ + /** + * Sample code: Delete a dicomservice. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteADicomservice(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.dicomServices().delete("testRG", "blue", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesGetSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesGetSamples.java new file mode 100644 index 000000000000..4cb552cd0cbf --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for DicomServices Get. */ +public final class DicomServicesGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Get.json + */ + /** + * Sample code: Get a dicomservice. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getADicomservice(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.dicomServices().getWithResponse("testRG", "workspace1", "blue", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesListByWorkspaceSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesListByWorkspaceSamples.java new file mode 100644 index 000000000000..02cc6ee14861 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesListByWorkspaceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for DicomServices ListByWorkspace. */ +public final class DicomServicesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_List.json + */ + /** + * Sample code: List dicomservices. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listDicomservices(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.dicomServices().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesUpdateSamples.java new file mode 100644 index 000000000000..9ab21e916d06 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/DicomServicesUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.DicomService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DicomServices Update. */ +public final class DicomServicesUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Patch.json + */ + /** + * Sample code: Update a dicomservice. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void updateADicomservice(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + DicomService resource = + manager.dicomServices().getWithResponse("testRG", "workspace1", "blue", Context.NONE).getValue(); + resource.update().withTags(mapOf("tagKey", "tagValue")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirDestinationsListByIotConnectorSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirDestinationsListByIotConnectorSamples.java new file mode 100644 index 000000000000..03a29370868b --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirDestinationsListByIotConnectorSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for FhirDestinations ListByIotConnector. */ +public final class FhirDestinationsListByIotConnectorSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_List.json + */ + /** + * Sample code: List IoT Connectors. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listIoTConnectors(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.fhirDestinations().listByIotConnector("testRG", "workspace1", "blue", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesCreateOrUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..fc8aefa086d8 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesCreateOrUpdateSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAccessPolicyEntry; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAcrConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceAuthenticationConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceCorsConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceExportConfiguration; +import com.azure.resourcemanager.healthcareapis.models.FhirServiceKind; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FhirServices CreateOrUpdate. */ +public final class FhirServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Create.json + */ + /** + * Sample code: Create or update a Fhir Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAFhirService( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .fhirServices() + .define("fhirservice1") + .withExistingWorkspace("testRG", "workspace1") + .withRegion("westus") + .withTags(mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withKind(FhirServiceKind.FHIR_R4) + .withIdentity(new ServiceManagedIdentityIdentity().withType(ServiceManagedIdentityType.SYSTEM_ASSIGNED)) + .withAccessPolicies( + Arrays + .asList( + new FhirServiceAccessPolicyEntry().withObjectId("c487e7d1-3210-41a3-8ccc-e9372b78da47"), + new FhirServiceAccessPolicyEntry().withObjectId("5b307da8-43d4-492b-8b66-b0294ade872f"))) + .withAcrConfiguration(new FhirServiceAcrConfiguration().withLoginServers(Arrays.asList("test1.azurecr.io"))) + .withAuthenticationConfiguration( + new FhirServiceAuthenticationConfiguration() + .withAuthority("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc") + .withAudience("https://azurehealthcareapis.com") + .withSmartProxyEnabled(true)) + .withCorsConfiguration( + new FhirServiceCorsConfiguration() + .withOrigins(Arrays.asList("*")) + .withHeaders(Arrays.asList("*")) + .withMethods(Arrays.asList("DELETE", "GET", "OPTIONS", "PATCH", "POST", "PUT")) + .withMaxAge(1440) + .withAllowCredentials(false)) + .withExportConfiguration( + new FhirServiceExportConfiguration().withStorageAccountName("existingStorageAccount")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesDeleteSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesDeleteSamples.java new file mode 100644 index 000000000000..c8ffac907e56 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for FhirServices Delete. */ +public final class FhirServicesDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Delete.json + */ + /** + * Sample code: Delete a Fhir Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteAFhirService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.fhirServices().delete("testRG", "fhirservice1", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesGetSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesGetSamples.java new file mode 100644 index 000000000000..aba4c2e3e181 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for FhirServices Get. */ +public final class FhirServicesGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Get.json + */ + /** + * Sample code: Get a Fhir Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getAFhirService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.fhirServices().getWithResponse("testRG", "workspace1", "fhirservices1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesListByWorkspaceSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesListByWorkspaceSamples.java new file mode 100644 index 000000000000..9ca69a7b364e --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesListByWorkspaceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for FhirServices ListByWorkspace. */ +public final class FhirServicesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_List.json + */ + /** + * Sample code: List fhirservices. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listFhirservices(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.fhirServices().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesUpdateSamples.java new file mode 100644 index 000000000000..30f6b6490f29 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/FhirServicesUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.FhirService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FhirServices Update. */ +public final class FhirServicesUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Patch.json + */ + /** + * Sample code: Update a Fhir Service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void updateAFhirService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + FhirService resource = + manager.fhirServices().getWithResponse("testRG", "workspace1", "fhirservice1", Context.NONE).getValue(); + resource.update().withTags(mapOf("tagKey", "tagValue")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationCreateOrUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8d01345481ac --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.healthcareapis.models.IotIdentityResolutionType; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; +import java.io.IOException; + +/** Samples for IotConnectorFhirDestination CreateOrUpdate. */ +public final class IotConnectorFhirDestinationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Create.json + */ + /** + * Sample code: Create or update an Iot Connector FHIR destination. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAnIotConnectorFHIRDestination( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) throws IOException { + manager + .iotConnectorFhirDestinations() + .define("dest1") + .withExistingIotconnector("testRG", "workspace1", "blue") + .withResourceIdentityResolutionType(IotIdentityResolutionType.CREATE) + .withFhirServiceResourceId( + "subscriptions/11111111-2222-3333-4444-555566667777/resourceGroups/myrg/providers/Microsoft.HealthcareApis/workspaces/myworkspace/fhirservices/myfhirservice") + .withFhirMapping( + new IotMappingProperties() + .withContent( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"template\":[{\"template\":{\"codes\":[{\"code\":\"8867-4\",\"display\":\"Heart" + + " rate\",\"system\":\"http://loinc.org\"}],\"periodInterval\":60,\"typeName\":\"heartrate\",\"value\":{\"defaultPeriod\":5000,\"unit\":\"count/min\",\"valueName\":\"hr\",\"valueType\":\"SampledData\"}},\"templateType\":\"CodeValueFhir\"}],\"templateType\":\"CollectionFhirTemplate\"}", + Object.class, + SerializerEncoding.JSON))) + .withRegion("westus") + .create(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationDeleteSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationDeleteSamples.java new file mode 100644 index 000000000000..1ba49ade50b2 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for IotConnectorFhirDestination Delete. */ +public final class IotConnectorFhirDestinationDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Delete.json + */ + /** + * Sample code: Delete an IoT Connector destination. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteAnIoTConnectorDestination( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectorFhirDestinations().delete("testRG", "workspace1", "blue", "dest1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationGetSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationGetSamples.java new file mode 100644 index 000000000000..1df0bc72c13d --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorFhirDestinationGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for IotConnectorFhirDestination Get. */ +public final class IotConnectorFhirDestinationGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Get.json + */ + /** + * Sample code: Get an IoT Connector destination. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getAnIoTConnectorDestination( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectorFhirDestinations().getWithResponse("testRG", "workspace1", "blue", "dest1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsCreateOrUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c48f90d2ec3b --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsCreateOrUpdateSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.healthcareapis.models.IotEventHubIngestionEndpointConfiguration; +import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityType; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotConnectors CreateOrUpdate. */ +public final class IotConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Create.json + */ + /** + * Sample code: Create an IoT Connector. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createAnIoTConnector(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) + throws IOException { + manager + .iotConnectors() + .define("blue") + .withExistingWorkspace("testRG", "workspace1") + .withRegion("westus") + .withTags(mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withIdentity(new ServiceManagedIdentityIdentity().withType(ServiceManagedIdentityType.SYSTEM_ASSIGNED)) + .withIngestionEndpointConfiguration( + new IotEventHubIngestionEndpointConfiguration() + .withEventHubName("MyEventHubName") + .withConsumerGroup("ConsumerGroupA") + .withFullyQualifiedEventHubNamespace("myeventhub.servicesbus.windows.net")) + .withDeviceMapping( + new IotMappingProperties() + .withContent( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"template\":[{\"template\":{\"deviceIdExpression\":\"$.deviceid\",\"timestampExpression\":\"$.measurementdatetime\",\"typeMatchExpression\":\"$..[?(@heartrate)]\",\"typeName\":\"heartrate\",\"values\":[{\"required\":\"true\",\"valueExpression\":\"$.heartrate\",\"valueName\":\"hr\"}]},\"templateType\":\"JsonPathContent\"}],\"templateType\":\"CollectionContent\"}", + Object.class, + SerializerEncoding.JSON))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsDeleteSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsDeleteSamples.java new file mode 100644 index 000000000000..0180d5571b73 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for IotConnectors Delete. */ +public final class IotConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Delete.json + */ + /** + * Sample code: Delete an IoT Connector. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteAnIoTConnector(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectors().delete("testRG", "blue", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsGetSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsGetSamples.java new file mode 100644 index 000000000000..d5c33ba230d2 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for IotConnectors Get. */ +public final class IotConnectorsGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Get.json + */ + /** + * Sample code: Get an IoT Connector. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getAnIoTConnector(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectors().getWithResponse("testRG", "workspace1", "blue", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsListByWorkspaceSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsListByWorkspaceSamples.java new file mode 100644 index 000000000000..06ee399ce4d4 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsListByWorkspaceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for IotConnectors ListByWorkspace. */ +public final class IotConnectorsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_List.json + */ + /** + * Sample code: List iotconnectors. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listIotconnectors(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.iotConnectors().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsUpdateSamples.java new file mode 100644 index 000000000000..154465e3c7c1 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/IotConnectorsUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.IotConnector; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotConnectors Update. */ +public final class IotConnectorsUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Patch.json + */ + /** + * Sample code: Patch an IoT Connector. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void patchAnIoTConnector(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + IotConnector resource = + manager.iotConnectors().getWithResponse("testRG", "workspace1", "blue", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withIdentity(new ServiceManagedIdentityIdentity().withType(ServiceManagedIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/OperationResultsGetSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/OperationResultsGetSamples.java new file mode 100644 index 000000000000..455069cb9ada --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/OperationResultsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for OperationResults Get. */ +public final class OperationResultsGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/OperationResultsGet.json + */ + /** + * Sample code: Get operation result. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getOperationResult(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.operationResults().getWithResponse("westus", "exampleid", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/OperationsListSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/OperationsListSamples.java new file mode 100644 index 000000000000..a60489f57f75 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/OperationsList.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listOperations(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8b23ac90dfc7 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.healthcareapis.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreatePrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_CreateOrUpdate. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .privateEndpointConnections() + .define("myConnection") + .withExistingService("rgname", "service1") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..09c0b9e46c8b --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceDeletePrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateEndpointConnectionsDelete( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateEndpointConnections().delete("rgname", "service1", "myConnection", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..b5896a7eeab3 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceGetPrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_GetConnection. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateEndpointConnectionGetConnection( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateEndpointConnections().getWithResponse("rgname", "service1", "myConnection", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsListByServiceSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsListByServiceSamples.java new file mode 100644 index 000000000000..f742572ab967 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateEndpointConnectionsListByServiceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByService. */ +public final class PrivateEndpointConnectionsListByServiceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceListPrivateEndpointConnections.json + */ + /** + * Sample code: PrivateEndpointConnection_List. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateEndpointConnectionList( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateEndpointConnections().listByService("rgname", "service1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateLinkResourcesGetSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..659a7ccce087 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/PrivateLinkResourceGet.json + */ + /** + * Sample code: PrivateLinkResources_Get. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateLinkResourcesGet(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateLinkResources().getWithResponse("rgname", "service1", "fhir", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateLinkResourcesListByServiceSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateLinkResourcesListByServiceSamples.java new file mode 100644 index 000000000000..a7db5c08c934 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/PrivateLinkResourcesListByServiceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByService. */ +public final class PrivateLinkResourcesListByServiceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/PrivateLinkResourcesListByService.json + */ + /** + * Sample code: PrivateLinkResources_ListGroupIds. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void privateLinkResourcesListGroupIds( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.privateLinkResources().listByServiceWithResponse("rgname", "service1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesCheckNameAvailabilitySamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..3afd2585bb0e --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesCheckNameAvailabilitySamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.CheckNameAvailabilityParameters; + +/** Samples for Services CheckNameAvailability. */ +public final class ServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/CheckNameAvailabilityPost.json + */ + /** + * Sample code: Check name availability. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void checkNameAvailability(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .services() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityParameters() + .withName("serviceName") + .withType("Microsoft.HealthcareApis/services"), + Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesCreateOrUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3ce996dd053a --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesCreateOrUpdateSamples.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.resourcemanager.healthcareapis.models.Kind; +import com.azure.resourcemanager.healthcareapis.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.healthcareapis.models.PublicNetworkAccess; +import com.azure.resourcemanager.healthcareapis.models.ServiceAccessPolicyEntry; +import com.azure.resourcemanager.healthcareapis.models.ServiceAuthenticationConfigurationInfo; +import com.azure.resourcemanager.healthcareapis.models.ServiceCorsConfigurationInfo; +import com.azure.resourcemanager.healthcareapis.models.ServiceCosmosDbConfigurationInfo; +import com.azure.resourcemanager.healthcareapis.models.ServiceExportConfigurationInfo; +import com.azure.resourcemanager.healthcareapis.models.ServicesProperties; +import com.azure.resourcemanager.healthcareapis.models.ServicesResourceIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services CreateOrUpdate. */ +public final class ServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreate.json + */ + /** + * Sample code: Create or Update a service with all parameters. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAServiceWithAllParameters( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .services() + .define("service1") + .withRegion("westus2") + .withExistingResourceGroup("rg1") + .withKind(Kind.FHIR_R4) + .withTags(mapOf()) + .withIdentity(new ServicesResourceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withProperties( + new ServicesProperties() + .withAccessPolicies( + Arrays + .asList( + new ServiceAccessPolicyEntry().withObjectId("c487e7d1-3210-41a3-8ccc-e9372b78da47"), + new ServiceAccessPolicyEntry().withObjectId("5b307da8-43d4-492b-8b66-b0294ade872f"))) + .withCosmosDbConfiguration( + new ServiceCosmosDbConfigurationInfo() + .withOfferThroughput(1000) + .withKeyVaultKeyUri("https://my-vault.vault.azure.net/keys/my-key")) + .withAuthenticationConfiguration( + new ServiceAuthenticationConfigurationInfo() + .withAuthority("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc") + .withAudience("https://azurehealthcareapis.com") + .withSmartProxyEnabled(true)) + .withCorsConfiguration( + new ServiceCorsConfigurationInfo() + .withOrigins(Arrays.asList("*")) + .withHeaders(Arrays.asList("*")) + .withMethods(Arrays.asList("DELETE", "GET", "OPTIONS", "PATCH", "POST", "PUT")) + .withMaxAge(1440) + .withAllowCredentials(false)) + .withExportConfiguration( + new ServiceExportConfigurationInfo().withStorageAccountName("existingStorageAccount")) + .withPrivateEndpointConnections(Arrays.asList()) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) + .create(); + } + + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreateMinimum.json + */ + /** + * Sample code: Create or Update a service with minimum parameters. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAServiceWithMinimumParameters( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .services() + .define("service2") + .withRegion("westus2") + .withExistingResourceGroup("rg1") + .withKind(Kind.FHIR_R4) + .withTags(mapOf()) + .withProperties( + new ServicesProperties() + .withAccessPolicies( + Arrays + .asList( + new ServiceAccessPolicyEntry().withObjectId("c487e7d1-3210-41a3-8ccc-e9372b78da47")))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesDeleteSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesDeleteSamples.java new file mode 100644 index 000000000000..44f252014ea4 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceDelete.json + */ + /** + * Sample code: Delete service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.services().delete("rg1", "service1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesGetByResourceGroupSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0d9062455a27 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for Services GetByResourceGroup. */ +public final class ServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceGet.json + */ + /** + * Sample code: Get metadata. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getMetadata(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.services().getByResourceGroupWithResponse("rg1", "service1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesListByResourceGroupSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..50cdb3431da9 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for Services ListByResourceGroup. */ +public final class ServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceListByResourceGroup.json + */ + /** + * Sample code: List all services in resource group. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listAllServicesInResourceGroup( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.services().listByResourceGroup("rgname", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesListSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesListSamples.java new file mode 100644 index 000000000000..2a7f33273a08 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceList.json + */ + /** + * Sample code: List all services in subscription. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void listAllServicesInSubscription( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.services().list(Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesUpdateSamples.java new file mode 100644 index 000000000000..e5fb5dc45c0f --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/ServicesUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.ServicesDescription; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services Update. */ +public final class ServicesUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServicePatch.json + */ + /** + * Sample code: Patch service. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void patchService(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + ServicesDescription resource = + manager.services().getByResourceGroupWithResponse("rg1", "service1", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..abbeeea4f919 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateEndpointConnectionDescriptionInner; +import com.azure.resourcemanager.healthcareapis.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.healthcareapis.models.PrivateLinkServiceConnectionState; + +/** Samples for WorkspacePrivateEndpointConnections CreateOrUpdate. */ +public final class WorkspacePrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceCreatePrivateEndpointConnection.json + */ + /** + * Sample code: WorkspacePrivateEndpointConnection_CreateOrUpdate. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .workspacePrivateEndpointConnections() + .createOrUpdate( + "testRG", + "workspace1", + "myConnection", + new PrivateEndpointConnectionDescriptionInner() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")), + Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsDeleteSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..ec7d6ad81837 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateEndpointConnections Delete. */ +public final class WorkspacePrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceDeletePrivateEndpointConnection.json + */ + /** + * Sample code: WorkspacePrivateEndpointConnections_Delete. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateEndpointConnectionsDelete( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspacePrivateEndpointConnections().delete("testRG", "workspace1", "myConnection", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsGetSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..a8a13c1c4fed --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateEndpointConnections Get. */ +public final class WorkspacePrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceGetPrivateEndpointConnection.json + */ + /** + * Sample code: WorkspacePrivateEndpointConnection_GetConnection. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateEndpointConnectionGetConnection( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .workspacePrivateEndpointConnections() + .getWithResponse("testRG", "workspace1", "myConnection", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsListByWorkspaceSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsListByWorkspaceSamples.java new file mode 100644 index 000000000000..c27396a1447a --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateEndpointConnectionsListByWorkspaceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateEndpointConnections ListByWorkspace. */ +public final class WorkspacePrivateEndpointConnectionsListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceListPrivateEndpointConnections.json + */ + /** + * Sample code: WorkspacePrivateEndpointConnection_List. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateEndpointConnectionList( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspacePrivateEndpointConnections().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateLinkResourcesGetSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..f7723401f805 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateLinkResourcesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateLinkResources Get. */ +public final class WorkspacePrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspacePrivateLinkResourceGet.json + */ + /** + * Sample code: WorkspacePrivateLinkResources_Get. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateLinkResourcesGet( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .workspacePrivateLinkResources() + .getWithResponse("testRG", "workspace1", "healthcareworkspace", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateLinkResourcesListByWorkspaceSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateLinkResourcesListByWorkspaceSamples.java new file mode 100644 index 000000000000..0f2468d0b9b0 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacePrivateLinkResourcesListByWorkspaceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for WorkspacePrivateLinkResources ListByWorkspace. */ +public final class WorkspacePrivateLinkResourcesListByWorkspaceSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/PrivateLinkResourcesListByWorkspace.json + */ + /** + * Sample code: WorkspacePrivateLinkResources_ListGroupIds. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void workspacePrivateLinkResourcesListGroupIds( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspacePrivateLinkResources().listByWorkspace("testRG", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c2a602cf6cb1 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.resourcemanager.healthcareapis.models.WorkspaceProperties; + +/** Samples for Workspaces CreateOrUpdate. */ +public final class WorkspacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Create.json + */ + /** + * Sample code: Create or update a workspace. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void createOrUpdateAWorkspace( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager + .workspaces() + .define("workspace1") + .withExistingResourceGroup("testRG") + .withRegion("westus") + .withProperties(new WorkspaceProperties()) + .create(); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesDeleteSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesDeleteSamples.java new file mode 100644 index 000000000000..49b0a3ce5dac --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for Workspaces Delete. */ +public final class WorkspacesDeleteSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Delete.json + */ + /** + * Sample code: Delete a workspace. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void deleteAWorkspace(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspaces().delete("testRG", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesGetByResourceGroupSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..ca4b44cd7dad --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for Workspaces GetByResourceGroup. */ +public final class WorkspacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Get.json + */ + /** + * Sample code: Get workspace. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getWorkspace(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspaces().getByResourceGroupWithResponse("testRG", "workspace1", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesListByResourceGroupSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesListByResourceGroupSamples.java new file mode 100644 index 000000000000..a4ab24aa54dc --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for Workspaces ListByResourceGroup. */ +public final class WorkspacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_ListByResourceGroup.json + */ + /** + * Sample code: Get workspaces by resource group. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getWorkspacesByResourceGroup( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspaces().listByResourceGroup("testRG", Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesListSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesListSamples.java new file mode 100644 index 000000000000..6a4388bb6164 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; + +/** Samples for Workspaces List. */ +public final class WorkspacesListSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_ListBySubscription.json + */ + /** + * Sample code: Get workspaces by subscription. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void getWorkspacesBySubscription( + com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + manager.workspaces().list(Context.NONE); + } +} diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesUpdateSamples.java new file mode 100644 index 000000000000..ffab21aab429 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthcareapis.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.healthcareapis.models.Workspace; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Workspaces Update. */ +public final class WorkspacesUpdateSamples { + /* + * x-ms-original-file: specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Patch.json + */ + /** + * Sample code: Update a workspace. + * + * @param manager Entry point to HealthcareApisManager. + */ + public static void updateAWorkspace(com.azure.resourcemanager.healthcareapis.HealthcareApisManager manager) { + Workspace resource = + manager.workspaces().getByResourceGroupWithResponse("testRG", "workspace1", Context.NONE).getValue(); + resource.update().withTags(mapOf("tagKey", "tagValue")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +}