diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/CHANGELOG.md b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/CHANGELOG.md index 3b362e2980811..47b8e3003611d 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 (2021-12-01) +- 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-preview-2021-06. 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 6127a609a5bdf..a38520aa3b012 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-preview-2021-06. 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 0000000000000..6aa297deb4357 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/SAMPLE.md @@ -0,0 +1,1238 @@ +# 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) + +## 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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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.ManagedServiceIdentityType; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +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/preview/2021-06-01-preview/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(ManagedServiceIdentityType.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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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.ManagedServiceIdentityType; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +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/preview/2021-06-01-preview/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(ManagedServiceIdentityType.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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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.ManagedServiceIdentityType; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +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/preview/2021-06-01-preview/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(ManagedServiceIdentityType.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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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; + } +} +``` + +### 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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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 6bf44ecccf96e..36a6b70c2104f 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml @@ -1,58 +1,81 @@ - 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-preview-2021-06. + 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 + + 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 false - - - - com.azure - azure-core - 1.23.0 - - - com.azure - azure-core-management - 1.4.3 - - + + + + com.azure + azure-core + 1.23.0 + + + com.azure + azure-core-management + 1.4.3 + + + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + 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 86d1c785db2d3..5f7fcf224dfc7 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,65 @@ 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.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.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 Operations operations; + + private OperationResults operationResults; + private final HealthcareApisManagementClient clientObject; private HealthcareApisManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -93,6 +119,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 +159,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 +226,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 +272,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 +289,71 @@ 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 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 0000000000000..18d82ee02ff38 --- /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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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 completion. + */ + @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 completion. + */ + @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 0000000000000..b6f78aa6cd5f0 --- /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. + */ + @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. + */ + @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 0000000000000..152346a157430 --- /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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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 completion. + */ + @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 completion. + */ + @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 5a3aa9a9322d1..c627c9e22a0fe 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,72 @@ 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 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 0000000000000..52e7e054154ca --- /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. + */ + @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 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 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 completion. + */ + @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 completion. + */ + @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 0000000000000..22e3f266761f6 --- /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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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 completion. + */ + @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 completion. + */ + @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/OperationsClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/OperationsClient.java index 60ab5d2d0cc44..62d3f9543231a 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. */ @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. */ @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 77e7644451479..2127d9ad3b93f 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 @@ -91,7 +91,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -113,7 +113,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -176,7 +176,7 @@ PrivateEndpointConnectionDescriptionInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName); @@ -193,7 +193,7 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @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/ServicesClient.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/ServicesClient.java index 05834993a96ba..a755aecf9a2e7 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 @@ -57,7 +57,7 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServicesDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, ServicesDescriptionInner serviceDescription); @@ -73,7 +73,7 @@ SyncPoller, ServicesDescriptionInner> begin * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return 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); @@ -119,7 +119,7 @@ ServicesDescriptionInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServicesDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, ServicesPatchDescription servicePatchDescription); @@ -135,7 +135,7 @@ SyncPoller, ServicesDescriptionInner> begin * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServicesDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -186,7 +186,7 @@ ServicesDescriptionInner update( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); /** @@ -200,7 +200,7 @@ ServicesDescriptionInner update( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, 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 0000000000000..64f38caed4569 --- /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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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 completion. + */ + @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 completion. + */ + @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 0000000000000..219fce2175000 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceInner.java @@ -0,0 +1,141 @@ +// 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.ProvisioningState; +import com.azure.resourcemanager.healthcareapis.models.TaggedResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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; + + /** + * 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; + } + + /** {@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(); + } + + /** + * Set the provisioningState property: The provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the DicomServiceInner object itself. + */ + public DicomServiceInner withProvisioningState(ProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new DicomServiceProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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 0000000000000..87304c491905e --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/DicomServiceProperties.java @@ -0,0 +1,97 @@ +// 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.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dicom Service properties. */ +@Fluent +public final class DicomServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DicomServiceProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState") + 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; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the DicomServiceProperties object itself. + */ + public DicomServiceProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationConfiguration() != null) { + authenticationConfiguration().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 0000000000000..d8fbf3250cf72 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceInner.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.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.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.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(); + } + + /** + * Set the provisioningState property: The provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the FhirServiceInner object itself. + */ + public FhirServiceInner withProvisioningState(ProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new FhirServiceProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * 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; + } + + /** + * 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 0000000000000..480646f026b09 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/FhirServiceProperties.java @@ -0,0 +1,203 @@ +// 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.ProvisioningState; +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") + 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; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the FhirServiceProperties object itself. + */ + public FhirServiceProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * 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; + } + + /** + * 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(); + } + } +} 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 0000000000000..9a7149e672343 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorInner.java @@ -0,0 +1,187 @@ +// 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(); + } + + /** + * Set the provisioningState property: The provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the IotConnectorInner object itself. + */ + public IotConnectorInner withProvisioningState(ProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new IotConnectorProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * 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 0000000000000..7fa72f6d34e60 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotConnectorProperties.java @@ -0,0 +1,112 @@ +// 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") + 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; + } + + /** + * Set the provisioningState property: The provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the IotConnectorProperties object itself. + */ + public IotConnectorProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * 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 0000000000000..e29234b74b562 --- /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 0000000000000..7f5d4d3af7f81 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/IotFhirDestinationProperties.java @@ -0,0 +1,137 @@ +// 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.azure.resourcemanager.healthcareapis.models.ProvisioningState; +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; + } + + /** {@inheritDoc} */ + @Override + public IotFhirDestinationProperties withProvisioningState(ProvisioningState provisioningState) { + super.withProvisioningState(provisioningState); + 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/OperationInner.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationDetailInner.java similarity index 52% rename from sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationInner.java rename to sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/models/OperationDetailInner.java index 664e4171f0b3a..339439b75e7ba 100644 --- 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/OperationDetailInner.java @@ -6,21 +6,35 @@ 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.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); +public final class OperationDetailInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetailInner.class); /* - * Operation name: {provider}/{resource}/{read | write | action | delete} + * 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'. */ @@ -28,13 +42,14 @@ public final class OperationInner { private String origin; /* - * The information displayed about the operation. + * Enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. */ - @JsonProperty(value = "display") - private OperationDisplay display; + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; /** - * Get the name property: Operation name: {provider}/{resource}/{read | write | action | delete}. + * Get the name property: Name of the operation. * * @return the name value. */ @@ -43,16 +58,17 @@ public String name() { } /** - * Get the origin property: Default value is 'user,system'. + * 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 origin value. + * @return the isDataAction value. */ - public String origin() { - return this.origin; + public Boolean isDataAction() { + return this.isDataAction; } /** - * Get the display property: The information displayed about the operation. + * Get the display property: Display of the operation. * * @return the display value. */ @@ -61,16 +77,35 @@ public OperationDisplay display() { } /** - * Set the display property: The information displayed about the operation. + * Set the display property: Display of the operation. * * @param display the display value to set. - * @return the OperationInner object itself. + * @return the OperationDetailInner object itself. */ - public OperationInner withDisplay(OperationDisplay display) { + 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; + } + /** * Validates the instance. * 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 c329e32cbd837..45fd5ab94b70f 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 0000000000000..3dc85065f8cdd --- /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 062a4cc4ece24..128cea8fc200d 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 0000000000000..3cda2b478fcfe --- /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 0000000000000..03b0702a96c22 --- /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 0000000000000..cbd5be2bae733 --- /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 0000000000000..7d01e5dd1e5ed --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServiceImpl.java @@ -0,0 +1,214 @@ +// 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.ProvisioningState; +import java.util.Collections; +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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DicomServiceAuthenticationConfiguration authenticationConfiguration() { + return this.innerModel().authenticationConfiguration(); + } + + public String serviceUrl() { + return this.innerModel().serviceUrl(); + } + + 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 withProvisioningState(ProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public DicomServiceImpl withAuthenticationConfiguration( + DicomServiceAuthenticationConfiguration authenticationConfiguration) { + this.innerModel().withAuthenticationConfiguration(authenticationConfiguration); + 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 0000000000000..7505478ee78b2 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/DicomServicesClientImpl.java @@ -0,0 +1,1475 @@ +// 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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. + */ + @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. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 the completion. + */ + @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 the completion. + */ + @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. + */ + @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. + */ + @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 0000000000000..4d9eb3d3ebc77 --- /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 0000000000000..36512b86ab704 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirDestinationsClientImpl.java @@ -0,0 +1,360 @@ +// 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 0000000000000..eaf684b5d717b --- /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 0000000000000..292ce5bfb7035 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServiceImpl.java @@ -0,0 +1,281 @@ +// 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.ProvisioningState; +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 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 withProvisioningState(ProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + 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; + } + + 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 0000000000000..a306870a8a13f --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/FhirServicesClientImpl.java @@ -0,0 +1,1471 @@ +// 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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. + */ + @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. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 the completion. + */ + @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 the completion. + */ + @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. + */ + @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. + */ + @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 0000000000000..ffc2d908f2d75 --- /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 fb4a7412bc0c8..3067f57ef8cc2 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,18 @@ 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.WorkspacesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -126,30 +132,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 +156,102 @@ 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 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 +274,18 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-01-11"; + this.apiVersion = "2021-06-01-preview"; 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.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 0000000000000..2d4b327ada2e6 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorFhirDestinationsClientImpl.java @@ -0,0 +1,979 @@ +// 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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. + */ + @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. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 the completion. + */ + @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 the completion. + */ + @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 0000000000000..1282b737fe7a9 --- /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 0000000000000..6e9b3e5150b8e --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorImpl.java @@ -0,0 +1,235 @@ +// 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 withProvisioningState(ProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + 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 0000000000000..6e0dc2ff63726 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/IotConnectorsClientImpl.java @@ -0,0 +1,1475 @@ +// 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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. + */ + @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. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 the completion. + */ + @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 the completion. + */ + @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. + */ + @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. + */ + @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 0000000000000..b33395c9112cd --- /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 0000000000000..d9de5b5c4bae8 --- /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 63% 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 ecb3ae9369f75..0ceda7d6c5c4b 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,19 @@ 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; -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 +25,23 @@ 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 OperationDetailInner innerModel() { return this.innerObject; } 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 e8a4fb33de199..84a9388fae8a9 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,14 @@ 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -99,7 +99,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 +112,16 @@ 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -144,55 +144,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. */ @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. */ @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. */ @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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } @@ -203,10 +203,10 @@ 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. */ @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 +219,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 +239,10 @@ 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. */ @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 7ba00ce85913f..aa1609d90b74c 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 1199820248275..c084ee1394706 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 @@ -624,7 +624,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -640,7 +640,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getHttpPipeline(), PrivateEndpointConnectionDescriptionInner.class, PrivateEndpointConnectionDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -657,7 +657,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -692,7 +692,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -717,7 +717,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -952,14 +952,15 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @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()); } /** @@ -975,7 +976,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @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); @@ -998,7 +999,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @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(); @@ -1017,7 +1018,7 @@ public SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @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) 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 570a825d4d381..ed6990cfac9ba 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 @@ -461,7 +461,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return 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()); } /** @@ -488,7 +488,7 @@ private PollerFlux, ServicesDescriptionInne * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return 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); @@ -515,7 +515,7 @@ private PollerFlux, ServicesDescriptionInne * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return 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(); @@ -533,7 +533,7 @@ public SyncPoller, ServicesDescriptionInner * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return 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(); @@ -739,7 +739,7 @@ private Mono>> updateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return 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()); } /** @@ -766,7 +766,7 @@ private PollerFlux, ServicesDescriptionInne * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServicesDescriptionInner> beginUpdateAsync( String resourceGroupName, String resourceName, @@ -796,7 +796,7 @@ private PollerFlux, ServicesDescriptionInne * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return 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(); @@ -814,7 +814,7 @@ public SyncPoller, ServicesDescriptionInner * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServicesDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -1006,12 +1006,13 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @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()); } /** @@ -1025,7 +1026,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @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); @@ -1045,7 +1046,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); } @@ -1061,7 +1062,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @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(); 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 0000000000000..cc5d1cef231e7 --- /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/WorkspacesClientImpl.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesClientImpl.java new file mode 100644 index 0000000000000..9389ed390462d --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/implementation/WorkspacesClientImpl.java @@ -0,0 +1,1557 @@ +// 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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 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 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. + */ + @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. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @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 the completion. + */ + @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 the completion. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 0000000000000..4c62c62fcb1b9 --- /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 0000000000000..599b4f1b89290 --- /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 0000000000000..3c3328b02efb1 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomService.java @@ -0,0 +1,263 @@ +// 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.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 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 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.WithProvisioningState, + DefinitionStages.WithAuthenticationConfiguration { + /** + * 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 provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioning state.. + * + * @param provisioningState The provisioning state. + * @return the next definition stage. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + /** 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); + } + } + /** + * 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 { + /** + * 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); + } + } + /** + * 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 0000000000000..49d76a75710f9 --- /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 0000000000000..f5197979cb994 --- /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 0000000000000..d1573f759e589 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/DicomServicePatchResource.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; + +/** Dicom Service patch properties. */ +@Fluent +public final class DicomServicePatchResource extends ResourceTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DicomServicePatchResource.class); + + /** {@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(); + } +} 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 0000000000000..1a1c8c9aff359 --- /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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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 0000000000000..48a0e9d8dab85 --- /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. + */ + 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. + */ + 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/FhirService.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirService.java new file mode 100644 index 0000000000000..71c819d559406 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirService.java @@ -0,0 +1,377 @@ +// 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 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.WithProvisioningState, + DefinitionStages.WithAccessPolicies, + DefinitionStages.WithAcrConfiguration, + DefinitionStages.WithAuthenticationConfiguration, + DefinitionStages.WithCorsConfiguration, + DefinitionStages.WithExportConfiguration { + /** + * 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 provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioning state.. + * + * @param provisioningState The provisioning state. + * @return the next definition stage. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + /** 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); + } + } + /** + * 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 0000000000000..1bdef448d3a40 --- /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 0000000000000..eb28b7cb19094 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAcrConfiguration.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.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; + + /** + * 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; + } + + /** + * 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/FhirServiceAuthenticationConfiguration.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/FhirServiceAuthenticationConfiguration.java new file mode 100644 index 0000000000000..25489e1500227 --- /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 0000000000000..d728e5145a2c0 --- /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 0000000000000..bd3eca8af2817 --- /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 0000000000000..2f205fdcb187f --- /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 0000000000000..4b5799c529954 --- /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 0000000000000..ef5c77c22ce1b --- /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 0000000000000..be6c8d15d75a1 --- /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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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 0000000000000..ffc37999a1a66 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotConnector.java @@ -0,0 +1,304 @@ +// 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.WithProvisioningState, + 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 provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioning state.. + * + * @param provisioningState The provisioning state. + * @return the next definition stage. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + /** 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 0000000000000..4cfbf6a1acef9 --- /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 0000000000000..435fd34d3551f --- /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. + */ + 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. + */ + 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. + */ + 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 0000000000000..9f5ea9bdf72d3 --- /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 0000000000000..ca0c0fc1a99e4 --- /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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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 0000000000000..cce01e3608281 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotDestinationProperties.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; + +/** Common IoT Connector destination properties. */ +@Fluent +public class IotDestinationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotDestinationProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the IotDestinationProperties object itself. + */ + public IotDestinationProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + 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/IotEventHubIngestionEndpointConfiguration.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/IotEventHubIngestionEndpointConfiguration.java new file mode 100644 index 0000000000000..605a4a6bafb29 --- /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 0000000000000..87ab6a66e1968 --- /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 0000000000000..c441f27acb36a --- /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 0000000000000..a99f43d7bcc8b --- /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 0000000000000..4c7d205fda081 --- /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 a9d42126eb6e7..14f405d745ad5 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 0000000000000..9c120f7b1cd5d --- /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/Operation.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operation.java deleted file mode 100644 index 01e3c6772951a..0000000000000 --- 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 0000000000000..1e1ae9d948991 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/OperationDetail.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.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 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/Operations.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Operations.java index 189739bf548a2..76bb752c1052d 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. */ - 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. */ - 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 ee92c7cfb92e5..b01d379587b10 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 3fc2b9e27847c..ebe028cae92f8 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/PrivateLinkResource.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/PrivateLinkResource.java index 351906f7140ee..0ea0d8668a101 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 f0d4e1f0d1323..734dd0fe7569c 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/ProvisioningState.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ProvisioningState.java index 525376c8037d5..6ed103cab9eef 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/ServiceManagedIdentity.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentity.java new file mode 100644 index 0000000000000..9d66d345ec013 --- /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; + +/** The managed identity of a service. */ +@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 0000000000000..8896a38639c53 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceManagedIdentityIdentity.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.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; + +/** 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") + private ManagedServiceIdentityType type; + + /** + * Get the type property: Type of identity being specified, currently SystemAssigned and None are allowed. + * + * @return the type value. + */ + public ManagedServiceIdentityType 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(ManagedServiceIdentityType type) { + this.type = type; + 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/ServicesPatchDescription.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServicesPatchDescription.java index 8ebaa40210617..58130fcf99a46 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 0000000000000..e96a962768fa5 --- /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/Workspace.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspace.java new file mode 100644 index 0000000000000..134915af23d8c --- /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 0000000000000..c5e0e28f2d109 --- /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 0000000000000..65b82b7e18515 --- /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/WorkspaceProperties.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceProperties.java new file mode 100644 index 0000000000000..f8cea43bd0a11 --- /dev/null +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/WorkspaceProperties.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; + +/** Workspaces resource specific properties. */ +@Fluent +public final class WorkspaceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + 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/Workspaces.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/Workspaces.java new file mode 100644 index 0000000000000..11e68317540de --- /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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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 0000000000000..c93c509662049 --- /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/preview/2021-06-01-preview/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 0000000000000..a516331b72d1b --- /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/preview/2021-06-01-preview/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 0000000000000..914ea0528805e --- /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/preview/2021-06-01-preview/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 0000000000000..0092f6aebf904 --- /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/preview/2021-06-01-preview/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 0000000000000..fda6f94bb16cc --- /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/preview/2021-06-01-preview/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 0000000000000..be5b58a4ae4d7 --- /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/preview/2021-06-01-preview/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 0000000000000..542bc982cda36 --- /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.ManagedServiceIdentityType; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +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/preview/2021-06-01-preview/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(ManagedServiceIdentityType.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 0000000000000..4265ac8192c3d --- /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/preview/2021-06-01-preview/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 0000000000000..f7c0dd5cb7485 --- /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/preview/2021-06-01-preview/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 0000000000000..6339f7fcf3990 --- /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/preview/2021-06-01-preview/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 0000000000000..47775937080d6 --- /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/preview/2021-06-01-preview/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 0000000000000..33849f0e1fbf5 --- /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/preview/2021-06-01-preview/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 0000000000000..3b86ca8c4fbff --- /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/preview/2021-06-01-preview/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 0000000000000..a32d07a43d790 --- /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/preview/2021-06-01-preview/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 0000000000000..094c51c774405 --- /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.ManagedServiceIdentityType; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +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/preview/2021-06-01-preview/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(ManagedServiceIdentityType.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 0000000000000..1495c73cf8f93 --- /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/preview/2021-06-01-preview/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 0000000000000..1adb9effe310e --- /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/preview/2021-06-01-preview/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 0000000000000..0e5096c6d1581 --- /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/preview/2021-06-01-preview/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 0000000000000..e3b129381406b --- /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.ManagedServiceIdentityType; +import com.azure.resourcemanager.healthcareapis.models.ServiceManagedIdentityIdentity; +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/preview/2021-06-01-preview/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(ManagedServiceIdentityType.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 0000000000000..72da925a14374 --- /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/preview/2021-06-01-preview/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 0000000000000..a1a4c5d270adb --- /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/preview/2021-06-01-preview/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 0000000000000..f7ba559f469ad --- /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/preview/2021-06-01-preview/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 0000000000000..00314ca3f30df --- /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/preview/2021-06-01-preview/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 0000000000000..ed79848d21bbd --- /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/preview/2021-06-01-preview/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 0000000000000..572a486293bae --- /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/preview/2021-06-01-preview/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 0000000000000..4c6cc3b72fb34 --- /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/preview/2021-06-01-preview/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 0000000000000..0899a15bb26b3 --- /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/preview/2021-06-01-preview/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 0000000000000..bf990160afea0 --- /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/preview/2021-06-01-preview/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 0000000000000..b3caf5ac6b137 --- /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/preview/2021-06-01-preview/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/preview/2021-06-01-preview/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 0000000000000..8b7483e27028e --- /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/preview/2021-06-01-preview/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 0000000000000..2636bffb59551 --- /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/preview/2021-06-01-preview/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 0000000000000..220d0c68ab498 --- /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/preview/2021-06-01-preview/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 0000000000000..cada44f054a92 --- /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/preview/2021-06-01-preview/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 0000000000000..9247c348f33a7 --- /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/preview/2021-06-01-preview/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/WorkspacesCreateOrUpdateSamples.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/samples/java/com/azure/resourcemanager/healthcareapis/generated/WorkspacesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..91adf12149bfb --- /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/preview/2021-06-01-preview/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 0000000000000..cafcf14052a5b --- /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/preview/2021-06-01-preview/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 0000000000000..ee85423123f74 --- /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/preview/2021-06-01-preview/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 0000000000000..9433159e0553f --- /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/preview/2021-06-01-preview/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 0000000000000..c134fa252cd9d --- /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/preview/2021-06-01-preview/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 0000000000000..7f8ebde64f354 --- /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/preview/2021-06-01-preview/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; + } +}