From 8ffb2e959769ac209a961c556cf4404803561b1b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 May 2022 17:14:34 +0000 Subject: [PATCH] CodeGen from PR 19204 in Azure/azure-rest-api-specs Merge 3ec2be66d630f3a5cddd95971c109aa76248d4a6 into d7216e49a7b0d5a7e15f77c4bab753208bf7870d --- .../CHANGELOG.md | 4 +- .../README.md | 2 +- .../SAMPLE.md | 120 +++ .../datafactory/DataFactoryManager.java | 39 +- .../fluent/DataFactoryManagementClient.java | 7 + .../fluent/GlobalParametersClient.java | 142 +++ ...ExecuteDataFlowActivityTypeProperties.java | 29 + ...ecutePowerQueryActivityTypeProperties.java | 7 + .../fluent/models/FactoryInner.java | 24 + .../fluent/models/FactoryProperties.java | 30 + .../models/GlobalParameterResourceInner.java | 121 +++ .../ActivityRunsClientImpl.java | 9 +- .../DataFactoryManagementClientImpl.java | 21 +- .../DataFlowDebugSessionsClientImpl.java | 12 +- .../implementation/DataFlowResourceImpl.java | 4 + .../implementation/DataFlowsClientImpl.java | 39 +- .../implementation/DatasetResourceImpl.java | 4 + .../implementation/DatasetsClientImpl.java | 39 +- .../ExposureControlsClientImpl.java | 27 +- .../implementation/FactoriesClientImpl.java | 74 +- .../implementation/FactoryImpl.java | 14 + .../GlobalParameterResourceImpl.java | 157 +++ .../GlobalParametersClientImpl.java | 899 ++++++++++++++++++ .../implementation/GlobalParametersImpl.java | 200 ++++ .../IntegrationRuntimeNodesClientImpl.java | 29 +- ...ationRuntimeObjectMetadatasClientImpl.java | 18 +- .../IntegrationRuntimeResourceImpl.java | 4 + .../IntegrationRuntimesClientImpl.java | 116 +-- .../LinkedServiceResourceImpl.java | 4 + .../LinkedServicesClientImpl.java | 38 +- .../ManagedPrivateEndpointResourceImpl.java | 4 + .../ManagedPrivateEndpointsClientImpl.java | 38 +- .../ManagedVirtualNetworkResourceImpl.java | 4 + .../ManagedVirtualNetworksClientImpl.java | 36 +- .../implementation/PipelineResourceImpl.java | 4 + .../PipelineRunsClientImpl.java | 22 +- .../implementation/PipelinesClientImpl.java | 57 +- ...ndpointConnectionOperationsClientImpl.java | 38 +- ...PrivateEndpointConnectionResourceImpl.java | 4 + .../PrivateLinkResourcesClientImpl.java | 10 +- .../implementation/TriggerResourceImpl.java | 4 + .../implementation/TriggerRunsClientImpl.java | 13 +- .../implementation/TriggersClientImpl.java | 57 +- .../datafactory/models/DataFlowResource.java | 7 + .../datafactory/models/DatasetResource.java | 7 + .../models/ExecuteDataFlowActivity.java | 25 + .../ExecuteWranglingDataflowActivity.java | 25 + .../datafactory/models/Factory.java | 25 + .../models/FactoryGitHubConfiguration.java | 6 +- .../models/GlobalParameterListResponse.java | 85 ++ .../models/GlobalParameterResource.java | 167 ++++ .../datafactory/models/GlobalParameters.java | 145 +++ .../models/IntegrationRuntimeResource.java | 7 + .../models/LinkedServiceResource.java | 7 + .../ManagedPrivateEndpointResource.java | 7 + .../models/ManagedVirtualNetworkResource.java | 7 + .../datafactory/models/PipelineResource.java | 7 + .../PrivateEndpointConnectionResource.java | 7 + .../models/PurviewConfiguration.java | 46 + .../datafactory/models/TriggerResource.java | 7 + ...GlobalParametersCreateOrUpdateSamples.java | 47 + .../GlobalParametersDeleteSamples.java | 24 + .../generated/GlobalParametersGetSamples.java | 24 + .../GlobalParametersListByFactorySamples.java | 22 + 64 files changed, 2623 insertions(+), 605 deletions(-) create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/GlobalParametersClient.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/GlobalParameterResourceInner.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParameterResourceImpl.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParametersClientImpl.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParametersImpl.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameterListResponse.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameterResource.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameters.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PurviewConfiguration.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersCreateOrUpdateSamples.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersDeleteSamples.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersGetSamples.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersListByFactorySamples.java diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/CHANGELOG.md b/sdk/datafactory/azure-resourcemanager-datafactory/CHANGELOG.md index f08a331dfc92..f578ac196e6c 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/CHANGELOG.md +++ b/sdk/datafactory/azure-resourcemanager-datafactory/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.16 (Unreleased) +## 1.0.0-beta.1 (2022-05-24) + +- Azure Resource Manager DataFactory client library for Java. This package contains Microsoft Azure SDK for DataFactory Management SDK. The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services. Package tag package-2018-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/README.md b/sdk/datafactory/azure-resourcemanager-datafactory/README.md index bfca1f4f28b0..aed548ba7545 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/README.md +++ b/sdk/datafactory/azure-resourcemanager-datafactory/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-datafactory - 1.0.0-beta.15 + 1.0.0-beta.16 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/SAMPLE.md b/sdk/datafactory/azure-resourcemanager-datafactory/SAMPLE.md index 5d92fdcdd6df..9a6b106006a2 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/SAMPLE.md +++ b/sdk/datafactory/azure-resourcemanager-datafactory/SAMPLE.md @@ -45,6 +45,13 @@ - [ListByResourceGroup](#factories_listbyresourcegroup) - [Update](#factories_update) +## GlobalParameters + +- [CreateOrUpdate](#globalparameters_createorupdate) +- [Delete](#globalparameters_delete) +- [Get](#globalparameters_get) +- [ListByFactory](#globalparameters_listbyfactory) + ## IntegrationRuntimeNodes - [Delete](#integrationruntimenodes_delete) @@ -1191,6 +1198,119 @@ public final class FactoriesUpdateSamples { } ``` +### GlobalParameters_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datafactory.models.GlobalParameterResource; +import com.azure.resourcemanager.datafactory.models.GlobalParameterSpecification; +import java.util.Map; + +/** Samples for GlobalParameters CreateOrUpdate. */ +public final class GlobalParametersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_Create.json + */ + /** + * Sample code: GlobalParameters_Create. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersCreate(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + manager + .globalParameters() + .define("default") + .withExistingFactory("exampleResourceGroup", "exampleFactoryName") + .withProperties((Map) null) + .create(); + } + + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_Update.json + */ + /** + * Sample code: GlobalParameters_Update. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersUpdate(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + GlobalParameterResource resource = + manager + .globalParameters() + .getWithResponse("exampleResourceGroup", "exampleFactoryName", "default", Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### GlobalParameters_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalParameters Delete. */ +public final class GlobalParametersDeleteSamples { + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_Delete.json + */ + /** + * Sample code: GlobalParameters_Delete. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersDelete(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + manager + .globalParameters() + .deleteWithResponse("exampleResourceGroup", "exampleFactoryName", "default", Context.NONE); + } +} +``` + +### GlobalParameters_Get + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalParameters Get. */ +public final class GlobalParametersGetSamples { + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_Get.json + */ + /** + * Sample code: GlobalParameters_Get. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersGet(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + manager + .globalParameters() + .getWithResponse("exampleResourceGroup", "exampleFactoryName", "default", Context.NONE); + } +} +``` + +### GlobalParameters_ListByFactory + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalParameters ListByFactory. */ +public final class GlobalParametersListByFactorySamples { + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_ListByFactory.json + */ + /** + * Sample code: GlobalParameters_ListByFactory. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersListByFactory(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + manager.globalParameters().listByFactory("exampleResourceGroup", "exampleFactoryName", Context.NONE); + } +} +``` + ### IntegrationRuntimeNodes_Delete ```java diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/DataFactoryManager.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/DataFactoryManager.java index 9bb8b0d2f960..22ca53205881 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/DataFactoryManager.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/DataFactoryManager.java @@ -31,6 +31,7 @@ import com.azure.resourcemanager.datafactory.implementation.DatasetsImpl; import com.azure.resourcemanager.datafactory.implementation.ExposureControlsImpl; import com.azure.resourcemanager.datafactory.implementation.FactoriesImpl; +import com.azure.resourcemanager.datafactory.implementation.GlobalParametersImpl; import com.azure.resourcemanager.datafactory.implementation.IntegrationRuntimeNodesImpl; import com.azure.resourcemanager.datafactory.implementation.IntegrationRuntimeObjectMetadatasImpl; import com.azure.resourcemanager.datafactory.implementation.IntegrationRuntimesImpl; @@ -51,6 +52,7 @@ import com.azure.resourcemanager.datafactory.models.Datasets; import com.azure.resourcemanager.datafactory.models.ExposureControls; import com.azure.resourcemanager.datafactory.models.Factories; +import com.azure.resourcemanager.datafactory.models.GlobalParameters; import com.azure.resourcemanager.datafactory.models.IntegrationRuntimeNodes; import com.azure.resourcemanager.datafactory.models.IntegrationRuntimeObjectMetadatas; import com.azure.resourcemanager.datafactory.models.IntegrationRuntimes; @@ -117,6 +119,8 @@ public final class DataFactoryManager { private PrivateLinkResources privateLinkResources; + private GlobalParameters globalParameters; + private final DataFactoryManagementClient clientObject; private DataFactoryManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -282,7 +286,7 @@ public DataFactoryManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.datafactory") .append("/") - .append("1.0.0-beta.15"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -352,7 +356,7 @@ public Operations operations() { } /** - * Gets the resource collection API of Factories. + * Gets the resource collection API of Factories. It manages Factory. * * @return Resource collection API of Factories. */ @@ -376,7 +380,7 @@ public ExposureControls exposureControls() { } /** - * Gets the resource collection API of IntegrationRuntimes. + * Gets the resource collection API of IntegrationRuntimes. It manages IntegrationRuntimeResource. * * @return Resource collection API of IntegrationRuntimes. */ @@ -414,7 +418,7 @@ public IntegrationRuntimeNodes integrationRuntimeNodes() { } /** - * Gets the resource collection API of LinkedServices. + * Gets the resource collection API of LinkedServices. It manages LinkedServiceResource. * * @return Resource collection API of LinkedServices. */ @@ -426,7 +430,7 @@ public LinkedServices linkedServices() { } /** - * Gets the resource collection API of Datasets. + * Gets the resource collection API of Datasets. It manages DatasetResource. * * @return Resource collection API of Datasets. */ @@ -438,7 +442,7 @@ public Datasets datasets() { } /** - * Gets the resource collection API of Pipelines. + * Gets the resource collection API of Pipelines. It manages PipelineResource. * * @return Resource collection API of Pipelines. */ @@ -474,7 +478,7 @@ public ActivityRuns activityRuns() { } /** - * Gets the resource collection API of Triggers. + * Gets the resource collection API of Triggers. It manages TriggerResource. * * @return Resource collection API of Triggers. */ @@ -498,7 +502,7 @@ public TriggerRuns triggerRuns() { } /** - * Gets the resource collection API of DataFlows. + * Gets the resource collection API of DataFlows. It manages DataFlowResource. * * @return Resource collection API of DataFlows. */ @@ -522,7 +526,7 @@ public DataFlowDebugSessions dataFlowDebugSessions() { } /** - * Gets the resource collection API of ManagedVirtualNetworks. + * Gets the resource collection API of ManagedVirtualNetworks. It manages ManagedVirtualNetworkResource. * * @return Resource collection API of ManagedVirtualNetworks. */ @@ -535,7 +539,7 @@ public ManagedVirtualNetworks managedVirtualNetworks() { } /** - * Gets the resource collection API of ManagedPrivateEndpoints. + * Gets the resource collection API of ManagedPrivateEndpoints. It manages ManagedPrivateEndpointResource. * * @return Resource collection API of ManagedPrivateEndpoints. */ @@ -561,7 +565,8 @@ public PrivateEndPointConnections privateEndPointConnections() { } /** - * Gets the resource collection API of PrivateEndpointConnectionOperations. + * Gets the resource collection API of PrivateEndpointConnectionOperations. It manages + * PrivateEndpointConnectionResource. * * @return Resource collection API of PrivateEndpointConnectionOperations. */ @@ -586,6 +591,18 @@ public PrivateLinkResources privateLinkResources() { return privateLinkResources; } + /** + * Gets the resource collection API of GlobalParameters. It manages GlobalParameterResource. + * + * @return Resource collection API of GlobalParameters. + */ + public GlobalParameters globalParameters() { + if (this.globalParameters == null) { + this.globalParameters = new GlobalParametersImpl(clientObject.getGlobalParameters(), this); + } + return globalParameters; + } + /** * @return Wrapped service client DataFactoryManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/DataFactoryManagementClient.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/DataFactoryManagementClient.java index e3bd4205f845..6e9bbb0433f3 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/DataFactoryManagementClient.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/DataFactoryManagementClient.java @@ -183,4 +183,11 @@ public interface DataFactoryManagementClient { * @return the PrivateLinkResourcesClient object. */ PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the GlobalParametersClient object to access its operations. + * + * @return the GlobalParametersClient object. + */ + GlobalParametersClient getGlobalParameters(); } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/GlobalParametersClient.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/GlobalParametersClient.java new file mode 100644 index 000000000000..c40f5181cd5d --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/GlobalParametersClient.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.datafactory.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datafactory.fluent.models.GlobalParameterResourceInner; + +/** An instance of this class provides access to all the operations defined in GlobalParametersClient. */ +public interface GlobalParametersClient { + /** + * Lists Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Global parameters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFactory(String resourceGroupName, String factoryName); + + /** + * Lists Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @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 Global parameters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFactory( + String resourceGroupName, String factoryName, Context context); + + /** + * Gets a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Global parameter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GlobalParameterResourceInner get(String resourceGroupName, String factoryName, String globalParameterName); + + /** + * Gets a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @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 Global parameter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String factoryName, String globalParameterName, Context context); + + /** + * Creates or updates a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param defaultParameter Global parameter resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return global parameters resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GlobalParameterResourceInner createOrUpdate( + String resourceGroupName, + String factoryName, + String globalParameterName, + GlobalParameterResourceInner defaultParameter); + + /** + * Creates or updates a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param defaultParameter Global parameter resource definition. + * @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 global parameters resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String factoryName, + String globalParameterName, + GlobalParameterResourceInner defaultParameter, + Context context); + + /** + * Deletes a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 factoryName, String globalParameterName); + + /** + * Deletes a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String factoryName, String globalParameterName, Context context); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/ExecuteDataFlowActivityTypeProperties.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/ExecuteDataFlowActivityTypeProperties.java index dda012dce81b..878b0676a069 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/ExecuteDataFlowActivityTypeProperties.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/ExecuteDataFlowActivityTypeProperties.java @@ -63,6 +63,13 @@ public class ExecuteDataFlowActivityTypeProperties { @JsonProperty(value = "runConcurrently") private Object runConcurrently; + /* + * Specify number of parallel staging for sources applicable to the sink. + * Type: integer (or Expression with resultType integer) + */ + @JsonProperty(value = "sourceStagingConcurrency") + private Object sourceStagingConcurrency; + /** * Get the dataFlow property: Data flow reference. * @@ -210,6 +217,28 @@ public ExecuteDataFlowActivityTypeProperties withRunConcurrently(Object runConcu return this; } + /** + * Get the sourceStagingConcurrency property: Specify number of parallel staging for sources applicable to the sink. + * Type: integer (or Expression with resultType integer). + * + * @return the sourceStagingConcurrency value. + */ + public Object sourceStagingConcurrency() { + return this.sourceStagingConcurrency; + } + + /** + * Set the sourceStagingConcurrency property: Specify number of parallel staging for sources applicable to the sink. + * Type: integer (or Expression with resultType integer). + * + * @param sourceStagingConcurrency the sourceStagingConcurrency value to set. + * @return the ExecuteDataFlowActivityTypeProperties object itself. + */ + public ExecuteDataFlowActivityTypeProperties withSourceStagingConcurrency(Object sourceStagingConcurrency) { + this.sourceStagingConcurrency = sourceStagingConcurrency; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/ExecutePowerQueryActivityTypeProperties.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/ExecutePowerQueryActivityTypeProperties.java index ecef67d34b9a..f7c6206e9dc2 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/ExecutePowerQueryActivityTypeProperties.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/ExecutePowerQueryActivityTypeProperties.java @@ -125,6 +125,13 @@ public ExecutePowerQueryActivityTypeProperties withRunConcurrently(Object runCon return this; } + /** {@inheritDoc} */ + @Override + public ExecutePowerQueryActivityTypeProperties withSourceStagingConcurrency(Object sourceStagingConcurrency) { + super.withSourceStagingConcurrency(sourceStagingConcurrency); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/FactoryInner.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/FactoryInner.java index d32c90980cb6..8f9d8c0046de 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/FactoryInner.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/FactoryInner.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.datafactory.models.FactoryRepoConfiguration; import com.azure.resourcemanager.datafactory.models.GlobalParameterSpecification; import com.azure.resourcemanager.datafactory.models.PublicNetworkAccess; +import com.azure.resourcemanager.datafactory.models.PurviewConfiguration; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -153,6 +154,29 @@ public String version() { return this.innerProperties() == null ? null : this.innerProperties().version(); } + /** + * Get the purviewConfiguration property: Purview information of the factory. + * + * @return the purviewConfiguration value. + */ + public PurviewConfiguration purviewConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().purviewConfiguration(); + } + + /** + * Set the purviewConfiguration property: Purview information of the factory. + * + * @param purviewConfiguration the purviewConfiguration value to set. + * @return the FactoryInner object itself. + */ + public FactoryInner withPurviewConfiguration(PurviewConfiguration purviewConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new FactoryProperties(); + } + this.innerProperties().withPurviewConfiguration(purviewConfiguration); + return this; + } + /** * Get the repoConfiguration property: Git repo information of the factory. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/FactoryProperties.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/FactoryProperties.java index f00eebde9a88..67a3568b15f6 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/FactoryProperties.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/FactoryProperties.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.datafactory.models.FactoryRepoConfiguration; import com.azure.resourcemanager.datafactory.models.GlobalParameterSpecification; import com.azure.resourcemanager.datafactory.models.PublicNetworkAccess; +import com.azure.resourcemanager.datafactory.models.PurviewConfiguration; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -35,6 +36,12 @@ public final class FactoryProperties { @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private String version; + /* + * Purview information of the factory. + */ + @JsonProperty(value = "purviewConfiguration") + private PurviewConfiguration purviewConfiguration; + /* * Git repo information of the factory. */ @@ -87,6 +94,26 @@ public String version() { return this.version; } + /** + * Get the purviewConfiguration property: Purview information of the factory. + * + * @return the purviewConfiguration value. + */ + public PurviewConfiguration purviewConfiguration() { + return this.purviewConfiguration; + } + + /** + * Set the purviewConfiguration property: Purview information of the factory. + * + * @param purviewConfiguration the purviewConfiguration value to set. + * @return the FactoryProperties object itself. + */ + public FactoryProperties withPurviewConfiguration(PurviewConfiguration purviewConfiguration) { + this.purviewConfiguration = purviewConfiguration; + return this; + } + /** * Get the repoConfiguration property: Git repo information of the factory. * @@ -173,6 +200,9 @@ public FactoryProperties withPublicNetworkAccess(PublicNetworkAccess publicNetwo * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (purviewConfiguration() != null) { + purviewConfiguration().validate(); + } if (repoConfiguration() != null) { repoConfiguration().validate(); } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/GlobalParameterResourceInner.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/GlobalParameterResourceInner.java new file mode 100644 index 000000000000..916692af4bfe --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/GlobalParameterResourceInner.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.models.GlobalParameterSpecification; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Global parameters resource type. */ +@Fluent +public final class GlobalParameterResourceInner extends SubResource { + /* + * Properties of the global parameter. + */ + @JsonProperty(value = "properties", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /* + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Etag identifies change in the resource. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the properties property: Properties of the global parameter. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the global parameter. + * + * @param properties the properties value to set. + * @return the GlobalParameterResourceInner object itself. + */ + public GlobalParameterResourceInner withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Get the name property: The resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the etag property: Etag identifies change in the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** {@inheritDoc} */ + @Override + public GlobalParameterResourceInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model GlobalParameterResourceInner")); + } else { + properties() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GlobalParameterResourceInner.class); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ActivityRunsClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ActivityRunsClientImpl.java index 0440d2dbb186..38d19cc1a463 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ActivityRunsClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ActivityRunsClientImpl.java @@ -211,14 +211,7 @@ private Mono> queryByPipelineRunWithRes private Mono queryByPipelineRunAsync( String resourceGroupName, String factoryName, String runId, RunFilterParameters filterParameters) { return queryByPipelineRunWithResponseAsync(resourceGroupName, factoryName, runId, filterParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFactoryManagementClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFactoryManagementClientImpl.java index db43280b04a1..bc13e3a55864 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFactoryManagementClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFactoryManagementClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -28,6 +29,7 @@ import com.azure.resourcemanager.datafactory.fluent.DatasetsClient; import com.azure.resourcemanager.datafactory.fluent.ExposureControlsClient; import com.azure.resourcemanager.datafactory.fluent.FactoriesClient; +import com.azure.resourcemanager.datafactory.fluent.GlobalParametersClient; import com.azure.resourcemanager.datafactory.fluent.IntegrationRuntimeNodesClient; import com.azure.resourcemanager.datafactory.fluent.IntegrationRuntimeObjectMetadatasClient; import com.azure.resourcemanager.datafactory.fluent.IntegrationRuntimesClient; @@ -48,7 +50,6 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -367,6 +368,18 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } + /** The GlobalParametersClient object to access its operations. */ + private final GlobalParametersClient globalParameters; + + /** + * Gets the GlobalParametersClient object to access its operations. + * + * @return the GlobalParametersClient object. + */ + public GlobalParametersClient getGlobalParameters() { + return this.globalParameters; + } + /** * Initializes an instance of DataFactoryManagementClient client. * @@ -410,6 +423,7 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { this.privateEndPointConnections = new PrivateEndPointConnectionsClientImpl(this); this.privateEndpointConnectionOperations = new PrivateEndpointConnectionOperationsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.globalParameters = new GlobalParametersClientImpl(this); } /** @@ -428,10 +442,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowDebugSessionsClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowDebugSessionsClientImpl.java index 681975d8b331..c216a98b940a 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowDebugSessionsClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowDebugSessionsClientImpl.java @@ -742,14 +742,7 @@ private Mono> addDataFlowWithRe private Mono addDataFlowAsync( String resourceGroupName, String factoryName, DataFlowDebugPackage request) { return addDataFlowWithResponseAsync(resourceGroupName, factoryName, request) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -909,8 +902,7 @@ private Mono> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( String resourceGroupName, String factoryName, DeleteDataFlowDebugSessionRequest request) { - return deleteWithResponseAsync(resourceGroupName, factoryName, request) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, factoryName, request).flatMap(ignored -> Mono.empty()); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowResourceImpl.java index 0864cbefac52..5bf029222461 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowResourceImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowResourceImpl.java @@ -35,6 +35,10 @@ public String etag() { return this.innerModel().etag(); } + public String resourceGroupName() { + return resourceGroupName; + } + public DataFlowResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowsClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowsClientImpl.java index 7735c3e4094b..05c119285b16 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowsClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFlowsClientImpl.java @@ -291,14 +291,7 @@ private Mono createOrUpdateAsync( DataFlowResourceInner dataFlow, String ifMatch) { return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, dataFlowName, dataFlow, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -318,14 +311,7 @@ private Mono createOrUpdateAsync( String resourceGroupName, String factoryName, String dataFlowName, DataFlowResourceInner dataFlow) { final String ifMatch = null; return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, dataFlowName, dataFlow, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -501,14 +487,7 @@ private Mono> getWithResponseAsync( private Mono getAsync( String resourceGroupName, String factoryName, String dataFlowName, String ifNoneMatch) { return getWithResponseAsync(resourceGroupName, factoryName, dataFlowName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -526,14 +505,7 @@ private Mono getAsync( private Mono getAsync(String resourceGroupName, String factoryName, String dataFlowName) { final String ifNoneMatch = null; return getWithResponseAsync(resourceGroupName, factoryName, dataFlowName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -690,8 +662,7 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String factoryName, String dataFlowName) { - return deleteWithResponseAsync(resourceGroupName, factoryName, dataFlowName) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, factoryName, dataFlowName).flatMap(ignored -> Mono.empty()); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DatasetResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DatasetResourceImpl.java index e23fe8ad8c2f..556c7af3a09c 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DatasetResourceImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DatasetResourceImpl.java @@ -34,6 +34,10 @@ public String etag() { return this.innerModel().etag(); } + public String resourceGroupName() { + return resourceGroupName; + } + public DatasetResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DatasetsClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DatasetsClientImpl.java index b127ef11ef02..9bf39a7388c4 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DatasetsClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DatasetsClientImpl.java @@ -470,14 +470,7 @@ private Mono createOrUpdateAsync( DatasetResourceInner dataset, String ifMatch) { return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, datasetName, dataset, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -497,14 +490,7 @@ private Mono createOrUpdateAsync( String resourceGroupName, String factoryName, String datasetName, DatasetResourceInner dataset) { final String ifMatch = null; return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, datasetName, dataset, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -680,14 +666,7 @@ private Mono> getWithResponseAsync( private Mono getAsync( String resourceGroupName, String factoryName, String datasetName, String ifNoneMatch) { return getWithResponseAsync(resourceGroupName, factoryName, datasetName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -705,14 +684,7 @@ private Mono getAsync( private Mono getAsync(String resourceGroupName, String factoryName, String datasetName) { final String ifNoneMatch = null; return getWithResponseAsync(resourceGroupName, factoryName, datasetName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -869,8 +841,7 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String factoryName, String datasetName) { - return deleteWithResponseAsync(resourceGroupName, factoryName, datasetName) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, factoryName, datasetName).flatMap(ignored -> Mono.empty()); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ExposureControlsClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ExposureControlsClientImpl.java index 5bbc723feed7..1e3ed5fddefc 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ExposureControlsClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ExposureControlsClientImpl.java @@ -217,14 +217,7 @@ private Mono> getFeatureValueWithResponse private Mono getFeatureValueAsync( String locationId, ExposureControlRequest exposureControlRequest) { return getFeatureValueWithResponseAsync(locationId, exposureControlRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -389,14 +382,7 @@ private Mono> getFeatureValueByFactoryWit private Mono getFeatureValueByFactoryAsync( String resourceGroupName, String factoryName, ExposureControlRequest exposureControlRequest) { return getFeatureValueByFactoryWithResponseAsync(resourceGroupName, factoryName, exposureControlRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -570,14 +556,7 @@ private Mono> queryFeatureValuesByFa private Mono queryFeatureValuesByFactoryAsync( String resourceGroupName, String factoryName, ExposureControlBatchRequest exposureControlBatchRequest) { return queryFeatureValuesByFactoryWithResponseAsync(resourceGroupName, factoryName, exposureControlBatchRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/FactoriesClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/FactoriesClientImpl.java index f4a1a3eef486..9b2a5ae47a20 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/FactoriesClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/FactoriesClientImpl.java @@ -475,14 +475,7 @@ private Mono> configureFactoryRepoWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono configureFactoryRepoAsync(String locationId, FactoryRepoUpdate factoryRepoUpdate) { return configureFactoryRepoWithResponseAsync(locationId, factoryRepoUpdate) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -811,14 +804,7 @@ private Mono> createOrUpdateWithResponseAsync( private Mono createOrUpdateAsync( String resourceGroupName, String factoryName, FactoryInner factory, String ifMatch) { return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, factory, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -836,14 +822,7 @@ private Mono createOrUpdateAsync( private Mono createOrUpdateAsync(String resourceGroupName, String factoryName, FactoryInner factory) { final String ifMatch = null; return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, factory, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1013,14 +992,7 @@ private Mono> updateWithResponseAsync( private Mono updateAsync( String resourceGroupName, String factoryName, FactoryUpdateParameters factoryUpdateParameters) { return updateWithResponseAsync(resourceGroupName, factoryName, factoryUpdateParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1177,14 +1149,7 @@ private Mono> getByResourceGroupWithResponseAsync( private Mono getByResourceGroupAsync( String resourceGroupName, String factoryName, String ifNoneMatch) { return getByResourceGroupWithResponseAsync(resourceGroupName, factoryName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1201,14 +1166,7 @@ private Mono getByResourceGroupAsync( private Mono getByResourceGroupAsync(String resourceGroupName, String factoryName) { final String ifNoneMatch = null; return getByResourceGroupWithResponseAsync(resourceGroupName, factoryName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1351,7 +1309,7 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String factoryName) { - return deleteWithResponseAsync(resourceGroupName, factoryName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, factoryName).flatMap(ignored -> Mono.empty()); } /** @@ -1514,14 +1472,7 @@ private Mono> getGitHubAccessTokenWithR private Mono getGitHubAccessTokenAsync( String resourceGroupName, String factoryName, GitHubAccessTokenRequest gitHubAccessTokenRequest) { return getGitHubAccessTokenWithResponseAsync(resourceGroupName, factoryName, gitHubAccessTokenRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1686,14 +1637,7 @@ private Mono> getDataPlaneAccessWithResponse private Mono getDataPlaneAccessAsync( String resourceGroupName, String factoryName, UserAccessPolicy policy) { return getDataPlaneAccessWithResponseAsync(resourceGroupName, factoryName, policy) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/FactoryImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/FactoryImpl.java index 9256c83eaed8..07ffc3fcc4dc 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/FactoryImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/FactoryImpl.java @@ -18,6 +18,7 @@ import com.azure.resourcemanager.datafactory.models.GitHubAccessTokenResponse; import com.azure.resourcemanager.datafactory.models.GlobalParameterSpecification; import com.azure.resourcemanager.datafactory.models.PublicNetworkAccess; +import com.azure.resourcemanager.datafactory.models.PurviewConfiguration; import com.azure.resourcemanager.datafactory.models.UserAccessPolicy; import java.time.OffsetDateTime; import java.util.Collections; @@ -82,6 +83,10 @@ public String version() { return this.innerModel().version(); } + public PurviewConfiguration purviewConfiguration() { + return this.innerModel().purviewConfiguration(); + } + public FactoryRepoConfiguration repoConfiguration() { return this.innerModel().repoConfiguration(); } @@ -111,6 +116,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public FactoryInner innerModel() { return this.innerObject; } @@ -272,6 +281,11 @@ public FactoryImpl withAdditionalProperties(Map additionalProper return this; } + public FactoryImpl withPurviewConfiguration(PurviewConfiguration purviewConfiguration) { + this.innerModel().withPurviewConfiguration(purviewConfiguration); + return this; + } + public FactoryImpl withRepoConfiguration(FactoryRepoConfiguration repoConfiguration) { this.innerModel().withRepoConfiguration(repoConfiguration); return this; diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParameterResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParameterResourceImpl.java new file mode 100644 index 000000000000..76319b59d5f2 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParameterResourceImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datafactory.fluent.models.GlobalParameterResourceInner; +import com.azure.resourcemanager.datafactory.models.GlobalParameterResource; +import com.azure.resourcemanager.datafactory.models.GlobalParameterSpecification; +import java.util.Collections; +import java.util.Map; + +public final class GlobalParameterResourceImpl + implements GlobalParameterResource, GlobalParameterResource.Definition, GlobalParameterResource.Update { + private GlobalParameterResourceInner innerObject; + + private final com.azure.resourcemanager.datafactory.DataFactoryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public GlobalParameterResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datafactory.DataFactoryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String factoryName; + + private String globalParameterName; + + public GlobalParameterResourceImpl withExistingFactory(String resourceGroupName, String factoryName) { + this.resourceGroupName = resourceGroupName; + this.factoryName = factoryName; + return this; + } + + public GlobalParameterResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalParameters() + .createOrUpdateWithResponse( + resourceGroupName, factoryName, globalParameterName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public GlobalParameterResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalParameters() + .createOrUpdateWithResponse( + resourceGroupName, factoryName, globalParameterName, this.innerModel(), context) + .getValue(); + return this; + } + + GlobalParameterResourceImpl(String name, com.azure.resourcemanager.datafactory.DataFactoryManager serviceManager) { + this.innerObject = new GlobalParameterResourceInner(); + this.serviceManager = serviceManager; + this.globalParameterName = name; + } + + public GlobalParameterResourceImpl update() { + return this; + } + + public GlobalParameterResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalParameters() + .createOrUpdateWithResponse( + resourceGroupName, factoryName, globalParameterName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public GlobalParameterResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalParameters() + .createOrUpdateWithResponse( + resourceGroupName, factoryName, globalParameterName, this.innerModel(), context) + .getValue(); + return this; + } + + GlobalParameterResourceImpl( + GlobalParameterResourceInner innerObject, + com.azure.resourcemanager.datafactory.DataFactoryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.factoryName = Utils.getValueFromIdByName(innerObject.id(), "factories"); + this.globalParameterName = Utils.getValueFromIdByName(innerObject.id(), "globalParameters"); + } + + public GlobalParameterResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalParameters() + .getWithResponse(resourceGroupName, factoryName, globalParameterName, Context.NONE) + .getValue(); + return this; + } + + public GlobalParameterResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalParameters() + .getWithResponse(resourceGroupName, factoryName, globalParameterName, context) + .getValue(); + return this; + } + + public GlobalParameterResourceImpl withProperties(Map properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParametersClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParametersClientImpl.java new file mode 100644 index 000000000000..30214249b4de --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParametersClientImpl.java @@ -0,0 +1,899 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.datafactory.fluent.GlobalParametersClient; +import com.azure.resourcemanager.datafactory.fluent.models.GlobalParameterResourceInner; +import com.azure.resourcemanager.datafactory.models.GlobalParameterListResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GlobalParametersClient. */ +public final class GlobalParametersClientImpl implements GlobalParametersClient { + /** The proxy service used to perform REST calls. */ + private final GlobalParametersService service; + + /** The service client containing this operation class. */ + private final DataFactoryManagementClientImpl client; + + /** + * Initializes an instance of GlobalParametersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GlobalParametersClientImpl(DataFactoryManagementClientImpl client) { + this.service = + RestProxy.create(GlobalParametersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataFactoryManagementClientGlobalParameters to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataFactoryManagemen") + private interface GlobalParametersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory" + + "/factories/{factoryName}/globalParameters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFactory( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("factoryName") String factoryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory" + + "/factories/{factoryName}/globalParameters/{globalParameterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("factoryName") String factoryName, + @PathParam("globalParameterName") String globalParameterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory" + + "/factories/{factoryName}/globalParameters/{globalParameterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("factoryName") String factoryName, + @PathParam("globalParameterName") String globalParameterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GlobalParameterResourceInner defaultParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory" + + "/factories/{factoryName}/globalParameters/{globalParameterName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("factoryName") String factoryName, + @PathParam("globalParameterName") String globalParameterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFactoryNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Global parameters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFactorySinglePageAsync( + String resourceGroupName, String factoryName) { + 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 (factoryName == null) { + return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByFactory( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + factoryName, + this.client.getApiVersion(), + 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 Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @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 Global parameters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFactorySinglePageAsync( + String resourceGroupName, String factoryName, 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 (factoryName == null) { + return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByFactory( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + factoryName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Global parameters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFactoryAsync(String resourceGroupName, String factoryName) { + return new PagedFlux<>( + () -> listByFactorySinglePageAsync(resourceGroupName, factoryName), + nextLink -> listByFactoryNextSinglePageAsync(nextLink)); + } + + /** + * Lists Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @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 Global parameters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFactoryAsync( + String resourceGroupName, String factoryName, Context context) { + return new PagedFlux<>( + () -> listByFactorySinglePageAsync(resourceGroupName, factoryName, context), + nextLink -> listByFactoryNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Global parameters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFactory(String resourceGroupName, String factoryName) { + return new PagedIterable<>(listByFactoryAsync(resourceGroupName, factoryName)); + } + + /** + * Lists Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @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 Global parameters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFactory( + String resourceGroupName, String factoryName, Context context) { + return new PagedIterable<>(listByFactoryAsync(resourceGroupName, factoryName, context)); + } + + /** + * Gets a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Global parameter along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String factoryName, String globalParameterName) { + 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 (factoryName == null) { + return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); + } + if (globalParameterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalParameterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + factoryName, + globalParameterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @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 Global parameter along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String factoryName, String globalParameterName, 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 (factoryName == null) { + return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); + } + if (globalParameterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalParameterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + factoryName, + globalParameterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Global parameter on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String factoryName, String globalParameterName) { + return getWithResponseAsync(resourceGroupName, factoryName, globalParameterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Global parameter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GlobalParameterResourceInner get(String resourceGroupName, String factoryName, String globalParameterName) { + return getAsync(resourceGroupName, factoryName, globalParameterName).block(); + } + + /** + * Gets a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @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 Global parameter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String factoryName, String globalParameterName, Context context) { + return getWithResponseAsync(resourceGroupName, factoryName, globalParameterName, context).block(); + } + + /** + * Creates or updates a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param defaultParameter Global parameter resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return global parameters resource type along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String factoryName, + String globalParameterName, + GlobalParameterResourceInner defaultParameter) { + 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 (factoryName == null) { + return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); + } + if (globalParameterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalParameterName is required and cannot be null.")); + } + if (defaultParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); + } else { + defaultParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + factoryName, + globalParameterName, + this.client.getApiVersion(), + defaultParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param defaultParameter Global parameter resource definition. + * @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 global parameters resource type along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String factoryName, + String globalParameterName, + GlobalParameterResourceInner defaultParameter, + 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 (factoryName == null) { + return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); + } + if (globalParameterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalParameterName is required and cannot be null.")); + } + if (defaultParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); + } else { + defaultParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + factoryName, + globalParameterName, + this.client.getApiVersion(), + defaultParameter, + accept, + context); + } + + /** + * Creates or updates a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param defaultParameter Global parameter resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return global parameters resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String factoryName, + String globalParameterName, + GlobalParameterResourceInner defaultParameter) { + return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, globalParameterName, defaultParameter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param defaultParameter Global parameter resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return global parameters resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GlobalParameterResourceInner createOrUpdate( + String resourceGroupName, + String factoryName, + String globalParameterName, + GlobalParameterResourceInner defaultParameter) { + return createOrUpdateAsync(resourceGroupName, factoryName, globalParameterName, defaultParameter).block(); + } + + /** + * Creates or updates a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param defaultParameter Global parameter resource definition. + * @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 global parameters resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String factoryName, + String globalParameterName, + GlobalParameterResourceInner defaultParameter, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, factoryName, globalParameterName, defaultParameter, context) + .block(); + } + + /** + * Deletes a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String factoryName, String globalParameterName) { + 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 (factoryName == null) { + return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); + } + if (globalParameterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalParameterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + factoryName, + globalParameterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String factoryName, String globalParameterName, 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 (factoryName == null) { + return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); + } + if (globalParameterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalParameterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + factoryName, + globalParameterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String factoryName, String globalParameterName) { + return deleteWithResponseAsync(resourceGroupName, factoryName, globalParameterName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 factoryName, String globalParameterName) { + deleteAsync(resourceGroupName, factoryName, globalParameterName).block(); + } + + /** + * Deletes a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String factoryName, String globalParameterName, Context context) { + return deleteWithResponseAsync(resourceGroupName, factoryName, globalParameterName, 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 list of Global parameters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFactoryNextSinglePageAsync(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.listByFactoryNext(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 list of Global parameters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFactoryNextSinglePageAsync( + 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 + .listByFactoryNext(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/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParametersImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParametersImpl.java new file mode 100644 index 000000000000..bbf2bdbb2229 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/GlobalParametersImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.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.datafactory.fluent.GlobalParametersClient; +import com.azure.resourcemanager.datafactory.fluent.models.GlobalParameterResourceInner; +import com.azure.resourcemanager.datafactory.models.GlobalParameterResource; +import com.azure.resourcemanager.datafactory.models.GlobalParameters; + +public final class GlobalParametersImpl implements GlobalParameters { + private static final ClientLogger LOGGER = new ClientLogger(GlobalParametersImpl.class); + + private final GlobalParametersClient innerClient; + + private final com.azure.resourcemanager.datafactory.DataFactoryManager serviceManager; + + public GlobalParametersImpl( + GlobalParametersClient innerClient, com.azure.resourcemanager.datafactory.DataFactoryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByFactory(String resourceGroupName, String factoryName) { + PagedIterable inner = + this.serviceClient().listByFactory(resourceGroupName, factoryName); + return Utils.mapPage(inner, inner1 -> new GlobalParameterResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByFactory( + String resourceGroupName, String factoryName, Context context) { + PagedIterable inner = + this.serviceClient().listByFactory(resourceGroupName, factoryName, context); + return Utils.mapPage(inner, inner1 -> new GlobalParameterResourceImpl(inner1, this.manager())); + } + + public GlobalParameterResource get(String resourceGroupName, String factoryName, String globalParameterName) { + GlobalParameterResourceInner inner = + this.serviceClient().get(resourceGroupName, factoryName, globalParameterName); + if (inner != null) { + return new GlobalParameterResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String factoryName, String globalParameterName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, factoryName, globalParameterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GlobalParameterResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String factoryName, String globalParameterName) { + this.serviceClient().delete(resourceGroupName, factoryName, globalParameterName); + } + + public Response deleteWithResponse( + String resourceGroupName, String factoryName, String globalParameterName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, factoryName, globalParameterName, context); + } + + public GlobalParameterResource 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 factoryName = Utils.getValueFromIdByName(id, "factories"); + if (factoryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'factories'.", id))); + } + String globalParameterName = Utils.getValueFromIdByName(id, "globalParameters"); + if (globalParameterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalParameters'.", id))); + } + return this.getWithResponse(resourceGroupName, factoryName, globalParameterName, 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 factoryName = Utils.getValueFromIdByName(id, "factories"); + if (factoryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'factories'.", id))); + } + String globalParameterName = Utils.getValueFromIdByName(id, "globalParameters"); + if (globalParameterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalParameters'.", id))); + } + return this.getWithResponse(resourceGroupName, factoryName, globalParameterName, 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 factoryName = Utils.getValueFromIdByName(id, "factories"); + if (factoryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'factories'.", id))); + } + String globalParameterName = Utils.getValueFromIdByName(id, "globalParameters"); + if (globalParameterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalParameters'.", id))); + } + this.deleteWithResponse(resourceGroupName, factoryName, globalParameterName, Context.NONE); + } + + public Response 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 factoryName = Utils.getValueFromIdByName(id, "factories"); + if (factoryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'factories'.", id))); + } + String globalParameterName = Utils.getValueFromIdByName(id, "globalParameters"); + if (globalParameterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalParameters'.", id))); + } + return this.deleteWithResponse(resourceGroupName, factoryName, globalParameterName, context); + } + + private GlobalParametersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datafactory.DataFactoryManager manager() { + return this.serviceManager; + } + + public GlobalParameterResourceImpl define(String name) { + return new GlobalParameterResourceImpl(name, this.manager()); + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeNodesClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeNodesClientImpl.java index 3a4a96c590ac..4b17e47feaac 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeNodesClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeNodesClientImpl.java @@ -264,14 +264,7 @@ private Mono> getWithResponseAsy private Mono getAsync( String resourceGroupName, String factoryName, String integrationRuntimeName, String nodeName) { return getWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, nodeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -445,7 +438,7 @@ private Mono> deleteWithResponseAsync( private Mono deleteAsync( String resourceGroupName, String factoryName, String integrationRuntimeName, String nodeName) { return deleteWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, nodeName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -655,14 +648,7 @@ private Mono updateAsync( UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest) { return updateWithResponseAsync( resourceGroupName, factoryName, integrationRuntimeName, nodeName, updateIntegrationRuntimeNodeRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -858,14 +844,7 @@ private Mono> getIpAddressWithRes private Mono getIpAddressAsync( String resourceGroupName, String factoryName, String integrationRuntimeName, String nodeName) { return getIpAddressWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, nodeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeObjectMetadatasClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeObjectMetadatasClientImpl.java index add655d8aa92..9cc73d6d7081 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeObjectMetadatasClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeObjectMetadatasClientImpl.java @@ -517,14 +517,7 @@ private Mono getAsync( String integrationRuntimeName, GetSsisObjectMetadataRequest getMetadataRequest) { return getWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, getMetadataRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -543,14 +536,7 @@ private Mono getAsync( String resourceGroupName, String factoryName, String integrationRuntimeName) { final GetSsisObjectMetadataRequest getMetadataRequest = null; return getWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, getMetadataRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeResourceImpl.java index 604e701e62e4..a2e2a0319df3 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeResourceImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimeResourceImpl.java @@ -45,6 +45,10 @@ public String etag() { return this.innerModel().etag(); } + public String resourceGroupName() { + return resourceGroupName; + } + public IntegrationRuntimeResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimesClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimesClientImpl.java index 831f63338ed9..b34c91d97467 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimesClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/IntegrationRuntimesClientImpl.java @@ -711,14 +711,7 @@ private Mono createOrUpdateAsync( String ifMatch) { return createOrUpdateWithResponseAsync( resourceGroupName, factoryName, integrationRuntimeName, integrationRuntime, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -742,14 +735,7 @@ private Mono createOrUpdateAsync( final String ifMatch = null; return createOrUpdateWithResponseAsync( resourceGroupName, factoryName, integrationRuntimeName, integrationRuntime, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -938,14 +924,7 @@ private Mono> getWithResponseAsync( private Mono getAsync( String resourceGroupName, String factoryName, String integrationRuntimeName, String ifNoneMatch) { return getWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -964,14 +943,7 @@ private Mono getAsync( String resourceGroupName, String factoryName, String integrationRuntimeName) { final String ifNoneMatch = null; return getWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1172,14 +1144,7 @@ private Mono updateAsync( UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest) { return updateWithResponseAsync( resourceGroupName, factoryName, integrationRuntimeName, updateIntegrationRuntimeRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1351,7 +1316,7 @@ private Mono> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String factoryName, String integrationRuntimeName) { return deleteWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -1512,14 +1477,7 @@ private Mono> getStatusWithRespo private Mono getStatusAsync( String resourceGroupName, String factoryName, String integrationRuntimeName) { return getStatusWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1687,14 +1645,7 @@ public Response getStatusWithResponse( String resourceGroupName, String factoryName, String integrationRuntimeName) { return listOutboundNetworkDependenciesEndpointsWithResponseAsync( resourceGroupName, factoryName, integrationRuntimeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1866,14 +1817,7 @@ private Mono> getConnectionInfoW private Mono getConnectionInfoAsync( String resourceGroupName, String factoryName, String integrationRuntimeName) { return getConnectionInfoWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2071,14 +2015,7 @@ private Mono regenerateAuthKeyAsync( IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters) { return regenerateAuthKeyWithResponseAsync( resourceGroupName, factoryName, integrationRuntimeName, regenerateKeyParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2253,14 +2190,7 @@ private Mono> listAuthKeysWithResponse private Mono listAuthKeysAsync( String resourceGroupName, String factoryName, String integrationRuntimeName) { return listAuthKeysWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2958,7 +2888,7 @@ private Mono> syncCredentialsWithResponseAsync( private Mono syncCredentialsAsync( String resourceGroupName, String factoryName, String integrationRuntimeName) { return syncCredentialsWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -3130,14 +3060,7 @@ private Mono> getMonitoringDataW private Mono getMonitoringDataAsync( String resourceGroupName, String factoryName, String integrationRuntimeName) { return getMonitoringDataWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -3302,7 +3225,7 @@ private Mono> upgradeWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono upgradeAsync(String resourceGroupName, String factoryName, String integrationRuntimeName) { return upgradeWithResponseAsync(resourceGroupName, factoryName, integrationRuntimeName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -3493,7 +3416,7 @@ private Mono removeLinksAsync( LinkedIntegrationRuntimeRequest linkedIntegrationRuntimeRequest) { return removeLinksWithResponseAsync( resourceGroupName, factoryName, integrationRuntimeName, linkedIntegrationRuntimeRequest) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -3697,14 +3620,7 @@ private Mono createLinkedIntegrationRunti CreateLinkedIntegrationRuntimeRequest createLinkedIntegrationRuntimeRequest) { return createLinkedIntegrationRuntimeWithResponseAsync( resourceGroupName, factoryName, integrationRuntimeName, createLinkedIntegrationRuntimeRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/LinkedServiceResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/LinkedServiceResourceImpl.java index 6e757a8a76f8..755a931126c8 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/LinkedServiceResourceImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/LinkedServiceResourceImpl.java @@ -35,6 +35,10 @@ public String etag() { return this.innerModel().etag(); } + public String resourceGroupName() { + return resourceGroupName; + } + public LinkedServiceResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/LinkedServicesClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/LinkedServicesClientImpl.java index b45514d3913c..faa6191bcc94 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/LinkedServicesClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/LinkedServicesClientImpl.java @@ -476,14 +476,7 @@ private Mono createOrUpdateAsync( String ifMatch) { return createOrUpdateWithResponseAsync( resourceGroupName, factoryName, linkedServiceName, linkedService, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -507,14 +500,7 @@ private Mono createOrUpdateAsync( final String ifMatch = null; return createOrUpdateWithResponseAsync( resourceGroupName, factoryName, linkedServiceName, linkedService, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -696,14 +682,7 @@ private Mono> getWithResponseAsync( private Mono getAsync( String resourceGroupName, String factoryName, String linkedServiceName, String ifNoneMatch) { return getWithResponseAsync(resourceGroupName, factoryName, linkedServiceName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -722,14 +701,7 @@ private Mono getAsync( String resourceGroupName, String factoryName, String linkedServiceName) { final String ifNoneMatch = null; return getWithResponseAsync(resourceGroupName, factoryName, linkedServiceName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -889,7 +861,7 @@ private Mono> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String factoryName, String linkedServiceName) { return deleteWithResponseAsync(resourceGroupName, factoryName, linkedServiceName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedPrivateEndpointResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedPrivateEndpointResourceImpl.java index d2e26249653c..89a4d68ffbcb 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedPrivateEndpointResourceImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedPrivateEndpointResourceImpl.java @@ -37,6 +37,10 @@ public String etag() { return this.innerModel().etag(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ManagedPrivateEndpointResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedPrivateEndpointsClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedPrivateEndpointsClientImpl.java index e5d4245f248f..9777fde10b4d 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedPrivateEndpointsClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedPrivateEndpointsClientImpl.java @@ -542,14 +542,7 @@ private Mono createOrUpdateAsync( managedPrivateEndpointName, managedPrivateEndpoint, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -580,14 +573,7 @@ private Mono createOrUpdateAsync( managedPrivateEndpointName, managedPrivateEndpoint, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -821,14 +807,7 @@ private Mono getAsync( String ifNoneMatch) { return getWithResponseAsync( resourceGroupName, factoryName, managedVirtualNetworkName, managedPrivateEndpointName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -852,14 +831,7 @@ private Mono getAsync( final String ifNoneMatch = null; return getWithResponseAsync( resourceGroupName, factoryName, managedVirtualNetworkName, managedPrivateEndpointName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1072,7 +1044,7 @@ private Mono deleteAsync( String managedPrivateEndpointName) { return deleteWithResponseAsync( resourceGroupName, factoryName, managedVirtualNetworkName, managedPrivateEndpointName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedVirtualNetworkResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedVirtualNetworkResourceImpl.java index 77f617d40bf2..11ed7dbc1ca7 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedVirtualNetworkResourceImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedVirtualNetworkResourceImpl.java @@ -37,6 +37,10 @@ public String etag() { return this.innerModel().etag(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ManagedVirtualNetworkResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedVirtualNetworksClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedVirtualNetworksClientImpl.java index 45eb9c657f3c..010582946217 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedVirtualNetworksClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedVirtualNetworksClientImpl.java @@ -470,14 +470,7 @@ private Mono createOrUpdateAsync( String ifMatch) { return createOrUpdateWithResponseAsync( resourceGroupName, factoryName, managedVirtualNetworkName, managedVirtualNetwork, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -501,14 +494,7 @@ private Mono createOrUpdateAsync( final String ifMatch = null; return createOrUpdateWithResponseAsync( resourceGroupName, factoryName, managedVirtualNetworkName, managedVirtualNetwork, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -700,14 +686,7 @@ private Mono> getWithResponseAsync( private Mono getAsync( String resourceGroupName, String factoryName, String managedVirtualNetworkName, String ifNoneMatch) { return getWithResponseAsync(resourceGroupName, factoryName, managedVirtualNetworkName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -726,14 +705,7 @@ private Mono getAsync( String resourceGroupName, String factoryName, String managedVirtualNetworkName) { final String ifNoneMatch = null; return getWithResponseAsync(resourceGroupName, factoryName, managedVirtualNetworkName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelineResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelineResourceImpl.java index 4b1b57cd4e0a..57216cb0020b 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelineResourceImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelineResourceImpl.java @@ -110,6 +110,10 @@ public PipelinePolicy policy() { return this.innerModel().policy(); } + public String resourceGroupName() { + return resourceGroupName; + } + public PipelineResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelineRunsClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelineRunsClientImpl.java index e998303b8a14..bc1e1a526e04 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelineRunsClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelineRunsClientImpl.java @@ -230,14 +230,7 @@ private Mono> queryByFactoryWithRespons private Mono queryByFactoryAsync( String resourceGroupName, String factoryName, RunFilterParameters filterParameters) { return queryByFactoryWithResponseAsync(resourceGroupName, factoryName, filterParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -393,14 +386,7 @@ private Mono> getWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String factoryName, String runId) { return getWithResponseAsync(resourceGroupName, factoryName, runId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -560,7 +546,7 @@ private Mono> cancelWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAsync(String resourceGroupName, String factoryName, String runId, Boolean isRecursive) { return cancelWithResponseAsync(resourceGroupName, factoryName, runId, isRecursive) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -578,7 +564,7 @@ private Mono cancelAsync(String resourceGroupName, String factoryName, Str private Mono cancelAsync(String resourceGroupName, String factoryName, String runId) { final Boolean isRecursive = null; return cancelWithResponseAsync(resourceGroupName, factoryName, runId, isRecursive) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelinesClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelinesClientImpl.java index 67be758eb5c1..67bdbc1584c1 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelinesClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelinesClientImpl.java @@ -495,14 +495,7 @@ private Mono createOrUpdateAsync( PipelineResourceInner pipeline, String ifMatch) { return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, pipelineName, pipeline, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -522,14 +515,7 @@ private Mono createOrUpdateAsync( String resourceGroupName, String factoryName, String pipelineName, PipelineResourceInner pipeline) { final String ifMatch = null; return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, pipelineName, pipeline, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -705,14 +691,7 @@ private Mono> getWithResponseAsync( private Mono getAsync( String resourceGroupName, String factoryName, String pipelineName, String ifNoneMatch) { return getWithResponseAsync(resourceGroupName, factoryName, pipelineName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -730,14 +709,7 @@ private Mono getAsync( private Mono getAsync(String resourceGroupName, String factoryName, String pipelineName) { final String ifNoneMatch = null; return getWithResponseAsync(resourceGroupName, factoryName, pipelineName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -894,8 +866,7 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String factoryName, String pipelineName) { - return deleteWithResponseAsync(resourceGroupName, factoryName, pipelineName) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, factoryName, pipelineName).flatMap(ignored -> Mono.empty()); } /** @@ -1120,14 +1091,7 @@ private Mono createRunAsync( startActivityName, startFromFailure, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1158,14 +1122,7 @@ private Mono createRunAsync( startActivityName, startFromFailure, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateEndpointConnectionOperationsClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateEndpointConnectionOperationsClientImpl.java index e5de832fc4d7..fc75de17decb 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateEndpointConnectionOperationsClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateEndpointConnectionOperationsClientImpl.java @@ -281,14 +281,7 @@ private Mono createOrUpdateAsync( String ifMatch) { return createOrUpdateWithResponseAsync( resourceGroupName, factoryName, privateEndpointConnectionName, privateEndpointWrapper, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -312,14 +305,7 @@ private Mono createOrUpdateAsync( final String ifMatch = null; return createOrUpdateWithResponseAsync( resourceGroupName, factoryName, privateEndpointConnectionName, privateEndpointWrapper, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -511,14 +497,7 @@ private Mono> getWithResponseAs private Mono getAsync( String resourceGroupName, String factoryName, String privateEndpointConnectionName, String ifNoneMatch) { return getWithResponseAsync(resourceGroupName, factoryName, privateEndpointConnectionName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -537,14 +516,7 @@ private Mono getAsync( String resourceGroupName, String factoryName, String privateEndpointConnectionName) { final String ifNoneMatch = null; return getWithResponseAsync(resourceGroupName, factoryName, privateEndpointConnectionName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -714,7 +686,7 @@ private Mono> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String factoryName, String privateEndpointConnectionName) { return deleteWithResponseAsync(resourceGroupName, factoryName, privateEndpointConnectionName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateEndpointConnectionResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateEndpointConnectionResourceImpl.java index 30cf1fe27abf..46446ab664df 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateEndpointConnectionResourceImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateEndpointConnectionResourceImpl.java @@ -39,6 +39,10 @@ public String etag() { return this.innerModel().etag(); } + public String resourceGroupName() { + return resourceGroupName; + } + public PrivateEndpointConnectionResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateLinkResourcesClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateLinkResourcesClientImpl.java index 6731bb715e44..ebdc59388285 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PrivateLinkResourcesClientImpl.java @@ -174,15 +174,7 @@ private Mono> getWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String factoryName) { - return getWithResponseAsync(resourceGroupName, factoryName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(resourceGroupName, factoryName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggerResourceImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggerResourceImpl.java index 4f38fb40f159..ed13a6fc5132 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggerResourceImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggerResourceImpl.java @@ -36,6 +36,10 @@ public String etag() { return this.innerModel().etag(); } + public String resourceGroupName() { + return resourceGroupName; + } + public TriggerResourceInner innerModel() { return this.innerObject; } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggerRunsClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggerRunsClientImpl.java index 3aae7d7b0c4b..f9fa01cfe358 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggerRunsClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggerRunsClientImpl.java @@ -233,7 +233,7 @@ private Mono> rerunWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono rerunAsync(String resourceGroupName, String factoryName, String triggerName, String runId) { return rerunWithResponseAsync(resourceGroupName, factoryName, triggerName, runId) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -400,7 +400,7 @@ private Mono> cancelWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAsync(String resourceGroupName, String factoryName, String triggerName, String runId) { return cancelWithResponseAsync(resourceGroupName, factoryName, triggerName, runId) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -563,14 +563,7 @@ private Mono> queryByFactoryWithResponse private Mono queryByFactoryAsync( String resourceGroupName, String factoryName, RunFilterParameters filterParameters) { return queryByFactoryWithResponseAsync(resourceGroupName, factoryName, filterParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggersClientImpl.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggersClientImpl.java index 025cec522902..d227aae66564 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggersClientImpl.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggersClientImpl.java @@ -545,14 +545,7 @@ private Mono> queryByFactoryWithResponseAsyn private Mono queryByFactoryAsync( String resourceGroupName, String factoryName, TriggerFilterParameters filterParameters) { return queryByFactoryWithResponseAsync(resourceGroupName, factoryName, filterParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -745,14 +738,7 @@ private Mono createOrUpdateAsync( TriggerResourceInner trigger, String ifMatch) { return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, triggerName, trigger, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -772,14 +758,7 @@ private Mono createOrUpdateAsync( String resourceGroupName, String factoryName, String triggerName, TriggerResourceInner trigger) { final String ifMatch = null; return createOrUpdateWithResponseAsync(resourceGroupName, factoryName, triggerName, trigger, ifMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -955,14 +934,7 @@ private Mono> getWithResponseAsync( private Mono getAsync( String resourceGroupName, String factoryName, String triggerName, String ifNoneMatch) { return getWithResponseAsync(resourceGroupName, factoryName, triggerName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -980,14 +952,7 @@ private Mono getAsync( private Mono getAsync(String resourceGroupName, String factoryName, String triggerName) { final String ifNoneMatch = null; return getWithResponseAsync(resourceGroupName, factoryName, triggerName, ifNoneMatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1144,8 +1109,7 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String factoryName, String triggerName) { - return deleteWithResponseAsync(resourceGroupName, factoryName, triggerName) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, factoryName, triggerName).flatMap(ignored -> Mono.empty()); } /** @@ -1571,14 +1535,7 @@ private Mono> getEventSubscrip private Mono getEventSubscriptionStatusAsync( String resourceGroupName, String factoryName, String triggerName) { return getEventSubscriptionStatusWithResponseAsync(resourceGroupName, factoryName, triggerName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowResource.java index dd48147fe91a..a08edfe17997 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowResource.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowResource.java @@ -44,6 +44,13 @@ public interface DataFlowResource { */ String etag(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.DataFlowResourceInner object. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DatasetResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DatasetResource.java index 172c80198da2..c4b763ea8dc4 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DatasetResource.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DatasetResource.java @@ -44,6 +44,13 @@ public interface DatasetResource { */ String etag(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.DatasetResourceInner object. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecuteDataFlowActivity.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecuteDataFlowActivity.java index e8ca102e66e3..81d3cb54e6c4 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecuteDataFlowActivity.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecuteDataFlowActivity.java @@ -241,6 +241,31 @@ public ExecuteDataFlowActivity withRunConcurrently(Object runConcurrently) { return this; } + /** + * Get the sourceStagingConcurrency property: Specify number of parallel staging for sources applicable to the sink. + * Type: integer (or Expression with resultType integer). + * + * @return the sourceStagingConcurrency value. + */ + public Object sourceStagingConcurrency() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().sourceStagingConcurrency(); + } + + /** + * Set the sourceStagingConcurrency property: Specify number of parallel staging for sources applicable to the sink. + * Type: integer (or Expression with resultType integer). + * + * @param sourceStagingConcurrency the sourceStagingConcurrency value to set. + * @return the ExecuteDataFlowActivity object itself. + */ + public ExecuteDataFlowActivity withSourceStagingConcurrency(Object sourceStagingConcurrency) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new ExecuteDataFlowActivityTypeProperties(); + } + this.innerTypeProperties().withSourceStagingConcurrency(sourceStagingConcurrency); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecuteWranglingDataflowActivity.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecuteWranglingDataflowActivity.java index 4f6a47ae4971..2840fb3e9bcc 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecuteWranglingDataflowActivity.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecuteWranglingDataflowActivity.java @@ -302,6 +302,31 @@ public ExecuteWranglingDataflowActivity withRunConcurrently(Object runConcurrent return this; } + /** + * Get the sourceStagingConcurrency property: Specify number of parallel staging for sources applicable to the sink. + * Type: integer (or Expression with resultType integer). + * + * @return the sourceStagingConcurrency value. + */ + public Object sourceStagingConcurrency() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().sourceStagingConcurrency(); + } + + /** + * Set the sourceStagingConcurrency property: Specify number of parallel staging for sources applicable to the sink. + * Type: integer (or Expression with resultType integer). + * + * @param sourceStagingConcurrency the sourceStagingConcurrency value to set. + * @return the ExecuteWranglingDataflowActivity object itself. + */ + public ExecuteWranglingDataflowActivity withSourceStagingConcurrency(Object sourceStagingConcurrency) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new ExecutePowerQueryActivityTypeProperties(); + } + this.innerTypeProperties().withSourceStagingConcurrency(sourceStagingConcurrency); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/Factory.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/Factory.java index e1ee988783b3..db7127614efc 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/Factory.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/Factory.java @@ -90,6 +90,13 @@ public interface Factory { */ String version(); + /** + * Gets the purviewConfiguration property: Purview information of the factory. + * + * @return the purviewConfiguration value. + */ + PurviewConfiguration purviewConfiguration(); + /** * Gets the repoConfiguration property: Git repo information of the factory. * @@ -132,6 +139,13 @@ public interface Factory { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.FactoryInner object. * @@ -187,6 +201,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithAdditionalProperties, + DefinitionStages.WithPurviewConfiguration, DefinitionStages.WithRepoConfiguration, DefinitionStages.WithGlobalParameters, DefinitionStages.WithEncryption, @@ -237,6 +252,16 @@ interface WithAdditionalProperties { */ WithCreate withAdditionalProperties(Map additionalProperties); } + /** The stage of the Factory definition allowing to specify purviewConfiguration. */ + interface WithPurviewConfiguration { + /** + * Specifies the purviewConfiguration property: Purview information of the factory.. + * + * @param purviewConfiguration Purview information of the factory. + * @return the next definition stage. + */ + WithCreate withPurviewConfiguration(PurviewConfiguration purviewConfiguration); + } /** The stage of the Factory definition allowing to specify repoConfiguration. */ interface WithRepoConfiguration { /** diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/FactoryGitHubConfiguration.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/FactoryGitHubConfiguration.java index 8c6ae7a3dbc1..7aa3aa7fd07d 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/FactoryGitHubConfiguration.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/FactoryGitHubConfiguration.java @@ -15,7 +15,7 @@ @Fluent public final class FactoryGitHubConfiguration extends FactoryRepoConfiguration { /* - * GitHub Enterprise host name. For example: https://github.mydomain.com + * GitHub Enterprise host name. For example: `https://github.mydomain.com` */ @JsonProperty(value = "hostName") private String hostname; @@ -33,7 +33,7 @@ public final class FactoryGitHubConfiguration extends FactoryRepoConfiguration { private GitHubClientSecret clientSecret; /** - * Get the hostname property: GitHub Enterprise host name. For example: https://github.mydomain.com. + * Get the hostname property: GitHub Enterprise host name. For example: `https://github.mydomain.com`. * * @return the hostname value. */ @@ -42,7 +42,7 @@ public String hostname() { } /** - * Set the hostname property: GitHub Enterprise host name. For example: https://github.mydomain.com. + * Set the hostname property: GitHub Enterprise host name. For example: `https://github.mydomain.com`. * * @param hostname the hostname value to set. * @return the FactoryGitHubConfiguration object itself. diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameterListResponse.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameterListResponse.java new file mode 100644 index 000000000000..7f63cf1b5ce0 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameterListResponse.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.fluent.models.GlobalParameterResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Global parameters. */ +@Fluent +public final class GlobalParameterListResponse { + /* + * List of global parameters. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of results, if any remaining results exist. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of global parameters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of global parameters. + * + * @param value the value value to set. + * @return the GlobalParameterListResponse object itself. + */ + public GlobalParameterListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of results, if any remaining results exist. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of results, if any remaining results exist. + * + * @param nextLink the nextLink value to set. + * @return the GlobalParameterListResponse object itself. + */ + public GlobalParameterListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model GlobalParameterListResponse")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GlobalParameterListResponse.class); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameterResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameterResource.java new file mode 100644 index 000000000000..ba2abe03a691 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameterResource.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datafactory.fluent.models.GlobalParameterResourceInner; +import java.util.Map; + +/** An immutable client-side representation of GlobalParameterResource. */ +public interface GlobalParameterResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the properties property: Properties of the global parameter. + * + * @return the properties value. + */ + Map properties(); + + /** + * Gets the name property: The resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Etag identifies change in the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.GlobalParameterResourceInner object. + * + * @return the inner object. + */ + GlobalParameterResourceInner innerModel(); + + /** The entirety of the GlobalParameterResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The GlobalParameterResource definition stages. */ + interface DefinitionStages { + /** The first stage of the GlobalParameterResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the GlobalParameterResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, factoryName. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @return the next definition stage. + */ + WithProperties withExistingFactory(String resourceGroupName, String factoryName); + } + /** The stage of the GlobalParameterResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the global parameter.. + * + * @param properties Properties of the global parameter. + * @return the next definition stage. + */ + WithCreate withProperties(Map properties); + } + /** + * The stage of the GlobalParameterResource 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + GlobalParameterResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GlobalParameterResource create(Context context); + } + } + /** + * Begins update for the GlobalParameterResource resource. + * + * @return the stage of resource update. + */ + GlobalParameterResource.Update update(); + + /** The template for GlobalParameterResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GlobalParameterResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GlobalParameterResource apply(Context context); + } + /** The GlobalParameterResource update stages. */ + interface UpdateStages { + /** The stage of the GlobalParameterResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the global parameter.. + * + * @param properties Properties of the global parameter. + * @return the next definition stage. + */ + Update withProperties(Map properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GlobalParameterResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GlobalParameterResource refresh(Context context); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameters.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameters.java new file mode 100644 index 000000000000..74ce669c8ec1 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/GlobalParameters.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.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 GlobalParameters. */ +public interface GlobalParameters { + /** + * Lists Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Global parameters as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFactory(String resourceGroupName, String factoryName); + + /** + * Lists Global parameters. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @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 Global parameters as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFactory(String resourceGroupName, String factoryName, Context context); + + /** + * Gets a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Global parameter. + */ + GlobalParameterResource get(String resourceGroupName, String factoryName, String globalParameterName); + + /** + * Gets a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @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 Global parameter along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String factoryName, String globalParameterName, Context context); + + /** + * Deletes a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 factoryName, String globalParameterName); + + /** + * Deletes a Global parameter. + * + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String factoryName, String globalParameterName, Context context); + + /** + * Gets a Global parameter. + * + * @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 a Global parameter along with {@link Response}. + */ + GlobalParameterResource getById(String id); + + /** + * Gets a Global parameter. + * + * @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 a Global parameter along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Global parameter. + * + * @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 Global parameter. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new GlobalParameterResource resource. + * + * @param name resource name. + * @return the first stage of the new GlobalParameterResource definition. + */ + GlobalParameterResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/IntegrationRuntimeResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/IntegrationRuntimeResource.java index 7ba256970c78..89653f18a4e3 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/IntegrationRuntimeResource.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/IntegrationRuntimeResource.java @@ -45,6 +45,13 @@ public interface IntegrationRuntimeResource { */ String etag(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.IntegrationRuntimeResourceInner object. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/LinkedServiceResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/LinkedServiceResource.java index ec789d9d570f..53de401adf1c 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/LinkedServiceResource.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/LinkedServiceResource.java @@ -44,6 +44,13 @@ public interface LinkedServiceResource { */ String etag(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.LinkedServiceResourceInner object. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedPrivateEndpointResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedPrivateEndpointResource.java index 577b1f58e57b..9b804a106711 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedPrivateEndpointResource.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedPrivateEndpointResource.java @@ -44,6 +44,13 @@ public interface ManagedPrivateEndpointResource { */ String etag(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.ManagedPrivateEndpointResourceInner object. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkResource.java index daf29e38b32d..fb7e8d79218e 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkResource.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkResource.java @@ -44,6 +44,13 @@ public interface ManagedVirtualNetworkResource { */ String etag(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.ManagedVirtualNetworkResourceInner object. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PipelineResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PipelineResource.java index 57d99688b6b7..c45a36808e8a 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PipelineResource.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PipelineResource.java @@ -111,6 +111,13 @@ public interface PipelineResource { */ PipelinePolicy policy(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.PipelineResourceInner object. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PrivateEndpointConnectionResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PrivateEndpointConnectionResource.java index 84a7a3b9373f..da80e12fb271 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PrivateEndpointConnectionResource.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PrivateEndpointConnectionResource.java @@ -44,6 +44,13 @@ public interface PrivateEndpointConnectionResource { */ String etag(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.PrivateEndpointConnectionResourceInner object. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PurviewConfiguration.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PurviewConfiguration.java new file mode 100644 index 000000000000..69d30df33997 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/PurviewConfiguration.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Purview configuration. */ +@Fluent +public final class PurviewConfiguration { + /* + * Purview resource id. + */ + @JsonProperty(value = "purviewResourceId") + private String purviewResourceId; + + /** + * Get the purviewResourceId property: Purview resource id. + * + * @return the purviewResourceId value. + */ + public String purviewResourceId() { + return this.purviewResourceId; + } + + /** + * Set the purviewResourceId property: Purview resource id. + * + * @param purviewResourceId the purviewResourceId value to set. + * @return the PurviewConfiguration object itself. + */ + public PurviewConfiguration withPurviewResourceId(String purviewResourceId) { + this.purviewResourceId = purviewResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerResource.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerResource.java index 1167808101ad..1b8fcaaba494 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerResource.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerResource.java @@ -45,6 +45,13 @@ public interface TriggerResource { */ String etag(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datafactory.fluent.models.TriggerResourceInner object. * diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersCreateOrUpdateSamples.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c2d2327a0fc7 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datafactory.models.GlobalParameterResource; +import com.azure.resourcemanager.datafactory.models.GlobalParameterSpecification; +import java.util.Map; + +/** Samples for GlobalParameters CreateOrUpdate. */ +public final class GlobalParametersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_Create.json + */ + /** + * Sample code: GlobalParameters_Create. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersCreate(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + manager + .globalParameters() + .define("default") + .withExistingFactory("exampleResourceGroup", "exampleFactoryName") + .withProperties((Map) null) + .create(); + } + + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_Update.json + */ + /** + * Sample code: GlobalParameters_Update. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersUpdate(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + GlobalParameterResource resource = + manager + .globalParameters() + .getWithResponse("exampleResourceGroup", "exampleFactoryName", "default", Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersDeleteSamples.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersDeleteSamples.java new file mode 100644 index 000000000000..9532695f73c3 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalParameters Delete. */ +public final class GlobalParametersDeleteSamples { + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_Delete.json + */ + /** + * Sample code: GlobalParameters_Delete. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersDelete(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + manager + .globalParameters() + .deleteWithResponse("exampleResourceGroup", "exampleFactoryName", "default", Context.NONE); + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersGetSamples.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersGetSamples.java new file mode 100644 index 000000000000..9389384a1727 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalParameters Get. */ +public final class GlobalParametersGetSamples { + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_Get.json + */ + /** + * Sample code: GlobalParameters_Get. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersGet(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + manager + .globalParameters() + .getWithResponse("exampleResourceGroup", "exampleFactoryName", "default", Context.NONE); + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersListByFactorySamples.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersListByFactorySamples.java new file mode 100644 index 000000000000..3595f39322a2 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/samples/java/com/azure/resourcemanager/datafactory/generated/GlobalParametersListByFactorySamples.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.datafactory.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalParameters ListByFactory. */ +public final class GlobalParametersListByFactorySamples { + /* + * x-ms-original-file: specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/examples/GlobalParameters_ListByFactory.json + */ + /** + * Sample code: GlobalParameters_ListByFactory. + * + * @param manager Entry point to DataFactoryManager. + */ + public static void globalParametersListByFactory(com.azure.resourcemanager.datafactory.DataFactoryManager manager) { + manager.globalParameters().listByFactory("exampleResourceGroup", "exampleFactoryName", Context.NONE); + } +}