diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/CHANGELOG.md b/sdk/agrifood/azure-resourcemanager-agrifood/CHANGELOG.md index 50a5fd51ec76..39a48c5c1cab 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/CHANGELOG.md +++ b/sdk/agrifood/azure-resourcemanager-agrifood/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2025-04-03) + +- Azure Resource Manager AgriFood client library for Java. This package contains Microsoft Azure SDK for AgriFood Management SDK. APIs documentation for Microsoft Azure Data Manager for Agriculture Service. Package tag package-preview-2024-12-01-preview. 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/agrifood/azure-resourcemanager-agrifood/README.md b/sdk/agrifood/azure-resourcemanager-agrifood/README.md index 6c4e7d7301da..dc9b70706e04 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/README.md +++ b/sdk/agrifood/azure-resourcemanager-agrifood/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AgriFood client library for Java. -This package contains Microsoft Azure SDK for AgriFood Management SDK. APIs documentation for Azure AgFoodPlatform Resource Provider Service. Package tag package-preview-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for AgriFood Management SDK. APIs documentation for Microsoft Azure Data Manager for Agriculture Service. Package tag package-preview-2024-12-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ AgriFoodManager manager = AgriFoodManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/SAMPLE.md b/sdk/agrifood/azure-resourcemanager-agrifood/SAMPLE.md index 77e146d043fe..152339ad3381 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/SAMPLE.md +++ b/sdk/agrifood/azure-resourcemanager-agrifood/SAMPLE.md @@ -1,30 +1,37 @@ # Code snippets and samples -## Extensions +## CheckNameAvailability -- [CreateOrUpdate](#extensions_createorupdate) -- [Delete](#extensions_delete) -- [Get](#extensions_get) -- [ListByFarmBeats](#extensions_listbyfarmbeats) +- [CheckNameAvailability](#checknameavailability_checknameavailability) + +## DataConnectors -## FarmBeatsExtensions +- [CreateOrUpdate](#dataconnectors_createorupdate) +- [Delete](#dataconnectors_delete) +- [Get](#dataconnectors_get) +- [List](#dataconnectors_list) -- [Get](#farmbeatsextensions_get) -- [List](#farmbeatsextensions_list) +## DataManagerForAgricultureExtensions -## FarmBeatsModels +- [Get](#datamanagerforagricultureextensions_get) +- [List](#datamanagerforagricultureextensions_list) -- [CreateOrUpdate](#farmbeatsmodels_createorupdate) -- [Delete](#farmbeatsmodels_delete) -- [GetByResourceGroup](#farmbeatsmodels_getbyresourcegroup) -- [List](#farmbeatsmodels_list) -- [ListByResourceGroup](#farmbeatsmodels_listbyresourcegroup) -- [Update](#farmbeatsmodels_update) +## DataManagerForAgricultureResources -## Locations +- [CreateOrUpdate](#datamanagerforagricultureresources_createorupdate) +- [Delete](#datamanagerforagricultureresources_delete) +- [GetByResourceGroup](#datamanagerforagricultureresources_getbyresourcegroup) +- [List](#datamanagerforagricultureresources_list) +- [ListByResourceGroup](#datamanagerforagricultureresources_listbyresourcegroup) +- [Update](#datamanagerforagricultureresources_update) -- [CheckNameAvailability](#locations_checknameavailability) +## Extensions + +- [CreateOrUpdate](#extensions_createorupdate) +- [Delete](#extensions_delete) +- [Get](#extensions_get) +- [ListByDataManagerForAgriculture](#extensions_listbydatamanagerforagriculture) ## OperationResults @@ -57,177 +64,234 @@ - [Get](#solutionsdiscoverability_get) - [List](#solutionsdiscoverability_list) -### Extensions_CreateOrUpdate +### CheckNameAvailability_CheckNameAvailability ```java +import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; + /** - * Samples for Extensions CreateOrUpdate. + * Samples for CheckNameAvailability CheckNameAvailability. */ -public final class ExtensionsCreateOrUpdateSamples { +public final class CheckNameAvailabilityCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * Extensions_CreateOrUpdate.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * CheckNameAvailability_CheckNameAvailability_AlreadyExists.json */ /** - * Sample code: Extensions_CreateOrUpdate. + * Sample code: CheckNameAvailability_CheckNameAvailability_AlreadyExists. * * @param manager Entry point to AgriFoodManager. */ - public static void extensionsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.extensions() - .define("provider.extension") - .withExistingFarmBeat("examples-rg", "examples-farmbeatsResourceName") + public static void checkNameAvailabilityCheckNameAvailabilityAlreadyExists( + com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.checkNameAvailabilities() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("existingaccountname") + .withType("Microsoft.AgFoodPlatform/farmBeats"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * CheckNameAvailability_CheckNameAvailability_Available.json + */ + /** + * Sample code: CheckNameAvailability_CheckNameAvailability_Available. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void checkNameAvailabilityCheckNameAvailabilityAvailable( + com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.checkNameAvailabilities() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("newaccountname") + .withType("Microsoft.AgFoodPlatform/farmBeats"), com.azure.core.util.Context.NONE); + } +} +``` + +### DataConnectors_CreateOrUpdate + +```java +import com.azure.resourcemanager.agrifood.models.ApiKeyAuthCredentials; +import com.azure.resourcemanager.agrifood.models.DataConnectorProperties; +import com.azure.resourcemanager.agrifood.models.KeyVaultProperties; + +/** + * Samples for DataConnectors CreateOrUpdate. + */ +public final class DataConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataConnectors_CreateOrUpdate.json + */ + /** + * Sample code: DataConnectors_CreateOrUpdate. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void dataConnectorsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataConnectors() + .define("WeatherIBM") + .withExistingFarmBeat("examples-rg", "examples-dataManagerForAgricultureResourceName") + .withProperties(new DataConnectorProperties().withCredentials( + new ApiKeyAuthCredentials().withApiKey(new KeyVaultProperties().withKeyVaultUri("fakeTokenPlaceholder") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder")))) .create(); } } ``` -### Extensions_Delete +### DataConnectors_Delete ```java /** - * Samples for Extensions Delete. + * Samples for DataConnectors Delete. */ -public final class ExtensionsDeleteSamples { +public final class DataConnectorsDeleteSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * Extensions_Delete.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataConnectors_Delete.json */ /** - * Sample code: Extensions_Delete. + * Sample code: DataConnectors_Delete. * * @param manager Entry point to AgriFoodManager. */ - public static void extensionsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.extensions() - .deleteWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", + public static void dataConnectorsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataConnectors() + .deleteWithResponse("examples-rg", "examples-dataManagerForAgricultureResourceName", "SatelliteSentinelHub", com.azure.core.util.Context.NONE); } } ``` -### Extensions_Get +### DataConnectors_Get ```java /** - * Samples for Extensions Get. + * Samples for DataConnectors Get. */ -public final class ExtensionsGetSamples { +public final class DataConnectorsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * Extensions_Get.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataConnectors_Get.json */ /** - * Sample code: Extensions_Get. + * Sample code: DataConnectors_Get. * * @param manager Entry point to AgriFoodManager. */ - public static void extensionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.extensions() - .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", + public static void dataConnectorsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataConnectors() + .getWithResponse("examples-rg", "examples-dataManagerForAgricultureResourceName", "SatelliteSentinelHub", com.azure.core.util.Context.NONE); } } ``` -### Extensions_ListByFarmBeats +### DataConnectors_List ```java - /** - * Samples for Extensions ListByFarmBeats. + * Samples for DataConnectors List. */ -public final class ExtensionsListByFarmBeatsSamples { +public final class DataConnectorsListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * Extensions_ListByFarmBeats.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataConnectors_List.json */ /** - * Sample code: Extensions_ListByFarmBeats. + * Sample code: DataConnectors_List. * * @param manager Entry point to AgriFoodManager. */ - public static void extensionsListByFarmBeats(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.extensions() - .listByFarmBeats("examples-rg", "examples-farmbeatsResourceName", null, null, null, null, + public static void dataConnectorsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataConnectors() + .list("examples-rg", "examples-dataManagerForAgricultureResourceName", null, null, com.azure.core.util.Context.NONE); } } ``` -### FarmBeatsExtensions_Get +### DataManagerForAgricultureExtensions_Get ```java /** - * Samples for FarmBeatsExtensions Get. + * Samples for DataManagerForAgricultureExtensions Get. */ -public final class FarmBeatsExtensionsGetSamples { +public final class DataManagerForAgricultureExtensionsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsExtensions_Get.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureExtensions_Get.json */ /** - * Sample code: FarmBeatsExtensions_Get. + * Sample code: DataManagerForAgricultureExtensions_Get. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsExtensionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsExtensions().getWithResponse("DTN.ContentServices", com.azure.core.util.Context.NONE); + public static void + dataManagerForAgricultureExtensionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureExtensions() + .getWithResponse("DTN.ContentServices", com.azure.core.util.Context.NONE); } } ``` -### FarmBeatsExtensions_List +### DataManagerForAgricultureExtensions_List ```java /** - * Samples for FarmBeatsExtensions List. + * Samples for DataManagerForAgricultureExtensions List. */ -public final class FarmBeatsExtensionsListSamples { +public final class DataManagerForAgricultureExtensionsListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsExtensions_List.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureExtensions_List.json */ /** - * Sample code: FarmBeatsExtensions_List. + * Sample code: DataManagerForAgricultureExtensions_List. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsExtensionsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsExtensions().list(null, null, null, null, null, com.azure.core.util.Context.NONE); + public static void + dataManagerForAgricultureExtensionsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureExtensions() + .list(null, null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### FarmBeatsModels_CreateOrUpdate +### DataManagerForAgricultureResources_CreateOrUpdate ```java import java.util.HashMap; import java.util.Map; /** - * Samples for FarmBeatsModels CreateOrUpdate. + * Samples for DataManagerForAgricultureResources CreateOrUpdate. */ -public final class FarmBeatsModelsCreateOrUpdateSamples { +public final class DataManagerForAgricultureResourcesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_CreateOrUpdate.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_CreateOrUpdate.json */ /** - * Sample code: FarmBeatsModels_CreateOrUpdate. + * Sample code: DataManagerForAgricultureResources_CreateOrUpdate. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels() + public static void + dataManagerForAgricultureResourcesCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources() .define("examples-farmbeatsResourceName") .withRegion("eastus2") .withExistingResourceGroup("examples-rg") @@ -249,158 +313,137 @@ public final class FarmBeatsModelsCreateOrUpdateSamples { } ``` -### FarmBeatsModels_Delete +### DataManagerForAgricultureResources_Delete ```java /** - * Samples for FarmBeatsModels Delete. + * Samples for DataManagerForAgricultureResources Delete. */ -public final class FarmBeatsModelsDeleteSamples { +public final class DataManagerForAgricultureResourcesDeleteSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_Delete.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_Delete.json */ /** - * Sample code: FarmBeatsModels_Delete. + * Sample code: DataManagerForAgricultureResources_Delete. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels() - .deleteByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", + public static void + dataManagerForAgricultureResourcesDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources() + .deleteByResourceGroupWithResponse("examples-rg", "examples-dataManagerForAgricultureResourceName", com.azure.core.util.Context.NONE); } } ``` -### FarmBeatsModels_GetByResourceGroup +### DataManagerForAgricultureResources_GetByResourceGroup ```java /** - * Samples for FarmBeatsModels GetByResourceGroup. + * Samples for DataManagerForAgricultureResources GetByResourceGroup. */ -public final class FarmBeatsModelsGetByResourceGroupSamples { +public final class DataManagerForAgricultureResourcesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_Get.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_Get.json */ /** - * Sample code: FarmBeatsModels_Get. + * Sample code: DataManagerForAgricultureResources_Get. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels() + public static void + dataManagerForAgricultureResourcesGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources() .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", com.azure.core.util.Context.NONE); } } ``` -### FarmBeatsModels_List +### DataManagerForAgricultureResources_List ```java /** - * Samples for FarmBeatsModels List. + * Samples for DataManagerForAgricultureResources List. */ -public final class FarmBeatsModelsListSamples { +public final class DataManagerForAgricultureResourcesListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_ListBySubscription.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_ListBySubscription.json */ /** - * Sample code: FarmBeatsModels_ListBySubscription. + * Sample code: DataManagerForAgricultureResources_ListBySubscription. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsListBySubscription(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels().list(null, null, com.azure.core.util.Context.NONE); + public static void dataManagerForAgricultureResourcesListBySubscription( + com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### FarmBeatsModels_ListByResourceGroup +### DataManagerForAgricultureResources_ListByResourceGroup ```java /** - * Samples for FarmBeatsModels ListByResourceGroup. + * Samples for DataManagerForAgricultureResources ListByResourceGroup. */ -public final class FarmBeatsModelsListByResourceGroupSamples { +public final class DataManagerForAgricultureResourcesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_ListByResourceGroup.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_ListByResourceGroup.json */ /** - * Sample code: FarmBeatsModels_ListByResourceGroup. + * Sample code: DataManagerForAgricultureResources_ListByResourceGroup. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsListByResourceGroup(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels().listByResourceGroup("examples-rg", null, null, com.azure.core.util.Context.NONE); + public static void dataManagerForAgricultureResourcesListByResourceGroup( + com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources() + .listByResourceGroup("examples-rg", null, null, com.azure.core.util.Context.NONE); } } ``` -### FarmBeatsModels_Update +### DataManagerForAgricultureResources_Update ```java -import com.azure.resourcemanager.agrifood.models.FarmBeats; -import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateProperties; -import com.azure.resourcemanager.agrifood.models.Identity; -import com.azure.resourcemanager.agrifood.models.ResourceIdentityType; -import com.azure.resourcemanager.agrifood.models.SensorIntegration; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgriculture; import java.util.HashMap; import java.util.Map; /** - * Samples for FarmBeatsModels Update. + * Samples for DataManagerForAgricultureResources Update. */ -public final class FarmBeatsModelsUpdateSamples { +public final class DataManagerForAgricultureResourcesUpdateSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_Update.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_Update.json */ /** - * Sample code: FarmBeatsModels_Update. + * Sample code: DataManagerForAgricultureResources_Update. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - FarmBeats resource = manager.farmBeatsModels() + public static void + dataManagerForAgricultureResourcesUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + DataManagerForAgriculture resource = manager.dataManagerForAgricultureResources() .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", com.azure.core.util.Context.NONE) .getValue(); resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); } - /* - * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_UpdateWithSensor.json - */ - /** - * Sample code: FarmBeatsModels_UpdateWithSensor. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsModelsUpdateWithSensor(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - FarmBeats resource = manager.farmBeatsModels() - .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties( - new FarmBeatsUpdateProperties().withSensorIntegration(new SensorIntegration().withEnabled("True"))) - .apply(); - } - // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { @@ -415,47 +458,105 @@ public final class FarmBeatsModelsUpdateSamples { } ``` -### Locations_CheckNameAvailability +### Extensions_CreateOrUpdate ```java -import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; +/** + * Samples for Extensions CreateOrUpdate. + */ +public final class ExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * Extensions_CreateOrUpdate.json + */ + /** + * Sample code: Extensions_CreateOrUpdate. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void extensionsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.extensions() + .define("provider.extension") + .withExistingFarmBeat("examples-rg", "examples-dataManagerForAgricultureResourceName") + .create(); + } +} +``` + +### Extensions_Delete +```java /** - * Samples for Locations CheckNameAvailability. + * Samples for Extensions Delete. */ -public final class LocationsCheckNameAvailabilitySamples { +public final class ExtensionsDeleteSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * Locations_CheckNameAvailability_Available.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * Extensions_Delete.json */ /** - * Sample code: Locations_CheckNameAvailability_Available. + * Sample code: Extensions_Delete. * * @param manager Entry point to AgriFoodManager. */ - public static void - locationsCheckNameAvailabilityAvailable(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.locations() - .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("newaccountname") - .withType("Microsoft.AgFoodPlatform/farmBeats"), com.azure.core.util.Context.NONE); + public static void extensionsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.extensions() + .deleteWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", + com.azure.core.util.Context.NONE); } +} +``` + +### Extensions_Get +```java +/** + * Samples for Extensions Get. + */ +public final class ExtensionsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * Locations_CheckNameAvailability_AlreadyExists.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * Extensions_Get.json + */ + /** + * Sample code: Extensions_Get. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void extensionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.extensions() + .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", + com.azure.core.util.Context.NONE); + } +} +``` + +### Extensions_ListByDataManagerForAgriculture + +```java + +/** + * Samples for Extensions ListByDataManagerForAgriculture. + */ +public final class ExtensionsListByDataManagerForAgricultureSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * Extensions_ListByDataManagerForAgriculture.json */ /** - * Sample code: Locations_CheckNameAvailability_AlreadyExists. + * Sample code: Extensions_ListByDataManagerForAgriculture. * * @param manager Entry point to AgriFoodManager. */ public static void - locationsCheckNameAvailabilityAlreadyExists(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.locations() - .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("existingaccountname") - .withType("Microsoft.AgFoodPlatform/farmBeats"), com.azure.core.util.Context.NONE); + extensionsListByDataManagerForAgriculture(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.extensions() + .listByDataManagerForAgriculture("examples-rg", "examples-farmbeatsResourceName", null, null, null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -469,7 +570,7 @@ public final class LocationsCheckNameAvailabilitySamples { public final class OperationResultsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * OperationResults_Get.json */ /** @@ -494,7 +595,7 @@ public final class OperationResultsGetSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Operations_List.json */ /** @@ -520,7 +621,7 @@ import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionSta public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateEndpointConnections_CreateOrUpdate.json */ /** @@ -550,7 +651,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { public final class PrivateEndpointConnectionsDeleteSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateEndpointConnections_Delete.json */ /** @@ -575,7 +676,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateEndpointConnections_Get.json */ /** @@ -600,7 +701,7 @@ public final class PrivateEndpointConnectionsGetSamples { public final class PrivateEndpointConnectionsListByResourceSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateEndpointConnections_ListByResource.json */ /** @@ -611,7 +712,8 @@ public final class PrivateEndpointConnectionsListByResourceSamples { public static void privateEndpointConnectionsListByResource(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { manager.privateEndpointConnections() - .listByResource("examples-rg", "examples-farmbeatsResourceName", com.azure.core.util.Context.NONE); + .listByResourceWithResponse("examples-rg", "examples-farmbeatsResourceName", + com.azure.core.util.Context.NONE); } } ``` @@ -625,7 +727,7 @@ public final class PrivateEndpointConnectionsListByResourceSamples { public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateLinkResources_Get.json */ /** @@ -650,7 +752,7 @@ public final class PrivateLinkResourcesGetSamples { public final class PrivateLinkResourcesListByResourceSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateLinkResources_ListByResource.json */ /** @@ -660,7 +762,8 @@ public final class PrivateLinkResourcesListByResourceSamples { */ public static void privateLinkResourcesListByResource(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { manager.privateLinkResources() - .listByResource("examples-rg", "examples-farmbeatsResourceName", com.azure.core.util.Context.NONE); + .listByResourceWithResponse("examples-rg", "examples-farmbeatsResourceName", + com.azure.core.util.Context.NONE); } } ``` @@ -668,17 +771,13 @@ public final class PrivateLinkResourcesListByResourceSamples { ### Solutions_CreateOrUpdate ```java -import com.azure.resourcemanager.agrifood.models.SolutionProperties; -import java.util.HashMap; -import java.util.Map; - /** * Samples for Solutions CreateOrUpdate. */ public final class SolutionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Solutions_CreateOrUpdate.json */ /** @@ -690,27 +789,8 @@ public final class SolutionsCreateOrUpdateSamples { manager.solutions() .define("abc.partner") .withExistingFarmBeat("examples-rg", "examples-farmbeatsResourceName") - .withProperties(new SolutionProperties().withSaasSubscriptionId("123") - .withSaasSubscriptionName("name") - .withMarketplacePublisherId("publisherId") - .withPlanId("planId") - .withOfferId("offerId") - .withTermId("termId") - .withAdditionalProperties(mapOf())) .create(); } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } ``` @@ -723,7 +803,7 @@ public final class SolutionsCreateOrUpdateSamples { public final class SolutionsDeleteSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Solutions_Delete.json */ /** @@ -748,7 +828,7 @@ public final class SolutionsDeleteSamples { public final class SolutionsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Solutions_Get.json */ /** @@ -774,7 +854,7 @@ public final class SolutionsGetSamples { public final class SolutionsListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Solutions_List.json */ /** @@ -799,7 +879,7 @@ public final class SolutionsListSamples { public final class SolutionsDiscoverabilityGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * SolutionsDiscoverability_Get.json */ /** @@ -823,7 +903,7 @@ public final class SolutionsDiscoverabilityGetSamples { public final class SolutionsDiscoverabilityListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * SolutionsDiscoverability_List.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml b/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml index 19a00a791340..35186598ba26 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml +++ b/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for AgriFood Management - This package contains Microsoft Azure SDK for AgriFood Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. APIs documentation for Azure AgFoodPlatform Resource Provider Service. Package tag package-preview-2021-09. + This package contains Microsoft Azure SDK for AgriFood Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. APIs documentation for Microsoft Azure Data Manager for Agriculture Service. Package tag package-preview-2024-12-01-preview. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/AgriFoodManager.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/AgriFoodManager.java index a1db75eead85..8d8a56ca4906 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/AgriFoodManager.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/AgriFoodManager.java @@ -22,23 +22,26 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.agrifood.fluent.AgriFoodManagementClient; import com.azure.resourcemanager.agrifood.implementation.AgriFoodManagementClientBuilder; +import com.azure.resourcemanager.agrifood.implementation.CheckNameAvailabilitiesImpl; +import com.azure.resourcemanager.agrifood.implementation.DataConnectorsImpl; +import com.azure.resourcemanager.agrifood.implementation.DataManagerForAgricultureExtensionsImpl; +import com.azure.resourcemanager.agrifood.implementation.DataManagerForAgricultureResourcesImpl; import com.azure.resourcemanager.agrifood.implementation.ExtensionsImpl; -import com.azure.resourcemanager.agrifood.implementation.FarmBeatsExtensionsImpl; -import com.azure.resourcemanager.agrifood.implementation.FarmBeatsModelsImpl; -import com.azure.resourcemanager.agrifood.implementation.LocationsImpl; import com.azure.resourcemanager.agrifood.implementation.OperationResultsImpl; import com.azure.resourcemanager.agrifood.implementation.OperationsImpl; import com.azure.resourcemanager.agrifood.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.agrifood.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.agrifood.implementation.SolutionsDiscoverabilitiesImpl; import com.azure.resourcemanager.agrifood.implementation.SolutionsImpl; +import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilities; +import com.azure.resourcemanager.agrifood.models.DataConnectors; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureExtensions; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureResources; import com.azure.resourcemanager.agrifood.models.Extensions; -import com.azure.resourcemanager.agrifood.models.FarmBeatsExtensions; -import com.azure.resourcemanager.agrifood.models.FarmBeatsModels; -import com.azure.resourcemanager.agrifood.models.Locations; import com.azure.resourcemanager.agrifood.models.OperationResults; import com.azure.resourcemanager.agrifood.models.Operations; import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnections; @@ -49,23 +52,26 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; /** * Entry point to AgriFoodManager. - * APIs documentation for Azure AgFoodPlatform Resource Provider Service. + * APIs documentation for Microsoft Azure Data Manager for Agriculture Service. */ public final class AgriFoodManager { - private Extensions extensions; + private CheckNameAvailabilities checkNameAvailabilities; + + private DataConnectors dataConnectors; - private FarmBeatsExtensions farmBeatsExtensions; + private DataManagerForAgricultureExtensions dataManagerForAgricultureExtensions; - private FarmBeatsModels farmBeatsModels; + private DataManagerForAgricultureResources dataManagerForAgricultureResources; private OperationResults operationResults; - private Locations locations; + private Extensions extensions; private Operations operations; @@ -129,6 +135,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-agrifood.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -236,12 +245,14 @@ public AgriFoodManager authenticate(TokenCredential credential, AzureProfile pro Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.agrifood") .append("/") - .append("1.0.0-beta.2"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -288,39 +299,54 @@ public AgriFoodManager authenticate(TokenCredential credential, AzureProfile pro } /** - * Gets the resource collection API of Extensions. It manages Extension. + * Gets the resource collection API of CheckNameAvailabilities. * - * @return Resource collection API of Extensions. + * @return Resource collection API of CheckNameAvailabilities. */ - public Extensions extensions() { - if (this.extensions == null) { - this.extensions = new ExtensionsImpl(clientObject.getExtensions(), this); + public CheckNameAvailabilities checkNameAvailabilities() { + if (this.checkNameAvailabilities == null) { + this.checkNameAvailabilities + = new CheckNameAvailabilitiesImpl(clientObject.getCheckNameAvailabilities(), this); } - return extensions; + return checkNameAvailabilities; + } + + /** + * Gets the resource collection API of DataConnectors. It manages DataConnector. + * + * @return Resource collection API of DataConnectors. + */ + public DataConnectors dataConnectors() { + if (this.dataConnectors == null) { + this.dataConnectors = new DataConnectorsImpl(clientObject.getDataConnectors(), this); + } + return dataConnectors; } /** - * Gets the resource collection API of FarmBeatsExtensions. + * Gets the resource collection API of DataManagerForAgricultureExtensions. * - * @return Resource collection API of FarmBeatsExtensions. + * @return Resource collection API of DataManagerForAgricultureExtensions. */ - public FarmBeatsExtensions farmBeatsExtensions() { - if (this.farmBeatsExtensions == null) { - this.farmBeatsExtensions = new FarmBeatsExtensionsImpl(clientObject.getFarmBeatsExtensions(), this); + public DataManagerForAgricultureExtensions dataManagerForAgricultureExtensions() { + if (this.dataManagerForAgricultureExtensions == null) { + this.dataManagerForAgricultureExtensions = new DataManagerForAgricultureExtensionsImpl( + clientObject.getDataManagerForAgricultureExtensions(), this); } - return farmBeatsExtensions; + return dataManagerForAgricultureExtensions; } /** - * Gets the resource collection API of FarmBeatsModels. It manages FarmBeats. + * Gets the resource collection API of DataManagerForAgricultureResources. It manages DataManagerForAgriculture. * - * @return Resource collection API of FarmBeatsModels. + * @return Resource collection API of DataManagerForAgricultureResources. */ - public FarmBeatsModels farmBeatsModels() { - if (this.farmBeatsModels == null) { - this.farmBeatsModels = new FarmBeatsModelsImpl(clientObject.getFarmBeatsModels(), this); + public DataManagerForAgricultureResources dataManagerForAgricultureResources() { + if (this.dataManagerForAgricultureResources == null) { + this.dataManagerForAgricultureResources = new DataManagerForAgricultureResourcesImpl( + clientObject.getDataManagerForAgricultureResources(), this); } - return farmBeatsModels; + return dataManagerForAgricultureResources; } /** @@ -336,15 +362,15 @@ public OperationResults operationResults() { } /** - * Gets the resource collection API of Locations. + * Gets the resource collection API of Extensions. It manages Extension. * - * @return Resource collection API of Locations. + * @return Resource collection API of Extensions. */ - public Locations locations() { - if (this.locations == null) { - this.locations = new LocationsImpl(clientObject.getLocations(), this); + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(clientObject.getExtensions(), this); } - return locations; + return extensions; } /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/AgriFoodManagementClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/AgriFoodManagementClient.java index 696ef5c62876..2e798b0da974 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/AgriFoodManagementClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/AgriFoodManagementClient.java @@ -47,25 +47,32 @@ public interface AgriFoodManagementClient { Duration getDefaultPollInterval(); /** - * Gets the ExtensionsClient object to access its operations. + * Gets the CheckNameAvailabilitiesClient object to access its operations. * - * @return the ExtensionsClient object. + * @return the CheckNameAvailabilitiesClient object. */ - ExtensionsClient getExtensions(); + CheckNameAvailabilitiesClient getCheckNameAvailabilities(); + + /** + * Gets the DataConnectorsClient object to access its operations. + * + * @return the DataConnectorsClient object. + */ + DataConnectorsClient getDataConnectors(); /** - * Gets the FarmBeatsExtensionsClient object to access its operations. + * Gets the DataManagerForAgricultureExtensionsClient object to access its operations. * - * @return the FarmBeatsExtensionsClient object. + * @return the DataManagerForAgricultureExtensionsClient object. */ - FarmBeatsExtensionsClient getFarmBeatsExtensions(); + DataManagerForAgricultureExtensionsClient getDataManagerForAgricultureExtensions(); /** - * Gets the FarmBeatsModelsClient object to access its operations. + * Gets the DataManagerForAgricultureResourcesClient object to access its operations. * - * @return the FarmBeatsModelsClient object. + * @return the DataManagerForAgricultureResourcesClient object. */ - FarmBeatsModelsClient getFarmBeatsModels(); + DataManagerForAgricultureResourcesClient getDataManagerForAgricultureResources(); /** * Gets the OperationResultsClient object to access its operations. @@ -75,11 +82,11 @@ public interface AgriFoodManagementClient { OperationResultsClient getOperationResults(); /** - * Gets the LocationsClient object to access its operations. + * Gets the ExtensionsClient object to access its operations. * - * @return the LocationsClient object. + * @return the ExtensionsClient object. */ - LocationsClient getLocations(); + ExtensionsClient getExtensions(); /** * Gets the OperationsClient object to access its operations. diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/LocationsClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/CheckNameAvailabilitiesClient.java similarity index 79% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/LocationsClient.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/CheckNameAvailabilitiesClient.java index a4621e4a353b..4317b6d25020 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/LocationsClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/CheckNameAvailabilitiesClient.java @@ -12,13 +12,13 @@ import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; /** - * An instance of this class provides access to all the operations defined in LocationsClient. + * An instance of this class provides access to all the operations defined in CheckNameAvailabilitiesClient. */ -public interface LocationsClient { +public interface CheckNameAvailabilitiesClient { /** * Checks the name availability of the resource with requested resource name. * - * @param body NameAvailabilityRequest object. + * @param nameAvailabilityRequest NameAvailabilityRequest object. * @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. @@ -26,18 +26,18 @@ public interface LocationsClient { * @return the check availability result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body, - Context context); + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context); /** * Checks the name availability of the resource with requested resource name. * - * @param body NameAvailabilityRequest object. + * @param nameAvailabilityRequest NameAvailabilityRequest object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the check availability result. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResponseInner checkNameAvailability(CheckNameAvailabilityRequest body); + CheckNameAvailabilityResponseInner checkNameAvailability(CheckNameAvailabilityRequest nameAvailabilityRequest); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataConnectorsClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataConnectorsClient.java new file mode 100644 index 000000000000..67b26af62d28 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataConnectorsClient.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.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.agrifood.fluent.models.DataConnectorInner; + +/** + * An instance of this class provides access to all the operations defined in DataConnectorsClient. + */ +public interface DataConnectorsClient { + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 specific Data Connector resource by DataConnectorName along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName, Context context); + + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 specific Data Connector resource by DataConnectorName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectorInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName); + + /** + * Create or update Data Connector For MADMA resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @param body Body must be valid DataConnector request. + * @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 dataConnector Model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String dataConnectorName, DataConnectorInner body, + Context context); + + /** + * Create or update Data Connector For MADMA resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @param body Body must be valid DataConnector request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataConnector Model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectorInner createOrUpdate(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName, DataConnectorInner body); + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @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 dataManagerForAgricultureResourceName, + String dataConnectorName, Context context); + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String dataConnectorName); + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 paged response contains list of requested objects and a URL link to get the next set of results as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName); + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Continuation token for getting next set of results. + * @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 paged response contains list of requested objects and a URL link to get the next set of results as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName, + Integer maxPageSize, String skipToken, Context context); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/FarmBeatsExtensionsClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataManagerForAgricultureExtensionsClient.java similarity index 61% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/FarmBeatsExtensionsClient.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataManagerForAgricultureExtensionsClient.java index 590b2f21ada8..c0cdbc5eb3ba 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/FarmBeatsExtensionsClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataManagerForAgricultureExtensionsClient.java @@ -9,28 +9,28 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureExtensionInner; import java.util.List; /** - * An instance of this class provides access to all the operations defined in FarmBeatsExtensionsClient. + * An instance of this class provides access to all the operations defined in DataManagerForAgricultureExtensionsClient. */ -public interface FarmBeatsExtensionsClient { +public interface DataManagerForAgricultureExtensionsClient { /** - * Get list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats extension as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture extension as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Get list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. + * @param farmBeatsExtensionIds DataManagerForAgricultureExtension ids. + * @param farmBeatsExtensionNames DataManagerForAgriculture extension names. * @param extensionCategories Extension categories. * @param publisherIds Publisher ids. * @param maxPageSize Maximum number of items needed (inclusive). @@ -39,35 +39,36 @@ public interface FarmBeatsExtensionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats extension as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture extension as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(List farmBeatsExtensionIds, + PagedIterable list(List farmBeatsExtensionIds, List farmBeatsExtensionNames, List extensionCategories, List publisherIds, Integer maxPageSize, Context context); /** - * Get farmBeats extension. + * Get Data Manager For Agriculture extension. * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param dataManagerForAgricultureExtensionId dataManagerForAgricultureExtensionId to be queried. * @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 farmBeats extension along with {@link Response}. + * @return data Manager For Agriculture extension along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String farmBeatsExtensionId, Context context); + Response getWithResponse(String dataManagerForAgricultureExtensionId, + Context context); /** - * Get farmBeats extension. + * Get Data Manager For Agriculture extension. * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param dataManagerForAgricultureExtensionId dataManagerForAgricultureExtensionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats extension. + * @return data Manager For Agriculture extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - FarmBeatsExtensionInner get(String farmBeatsExtensionId); + DataManagerForAgricultureExtensionInner get(String dataManagerForAgricultureExtensionId); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/FarmBeatsModelsClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataManagerForAgricultureResourcesClient.java similarity index 62% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/FarmBeatsModelsClient.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataManagerForAgricultureResourcesClient.java index 87c3c2b8d696..d42b90ee1176 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/FarmBeatsModelsClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataManagerForAgricultureResourcesClient.java @@ -11,137 +11,142 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateRequestModel; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureUpdateRequestModel; /** - * An instance of this class provides access to all the operations defined in FarmBeatsModelsClient. + * An instance of this class provides access to all the operations defined in DataManagerForAgricultureResourcesClient. */ -public interface FarmBeatsModelsClient { +public interface DataManagerForAgricultureResourcesClient { /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeats resource along with {@link Response}. + * @return dataManagerForAgriculture resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String farmBeatsResourceName, - Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context); /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeats resource. + * @return dataManagerForAgriculture resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - FarmBeatsInner getByResourceGroup(String resourceGroupName, String farmBeatsResourceName); + DataManagerForAgricultureInner getByResourceGroup(String resourceGroupName, + String dataManagerForAgricultureResourceName); /** - * Create or update FarmBeats resource. + * Create or update Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body FarmBeats resource create or update request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Data Manager For Agriculture resource create or update request object. * @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 farmBeats ARM Resource along with {@link Response}. + * @return data Manager For Agriculture ARM Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String farmBeatsResourceName, - FarmBeatsInner body, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request, Context context); /** - * Create or update FarmBeats resource. + * Create or update Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body FarmBeats resource create or update request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Data Manager For Agriculture resource create or update request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats ARM Resource. + * @return data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - FarmBeatsInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, FarmBeatsInner body); + DataManagerForAgricultureInner createOrUpdate(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request); /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of farmBeats ARM Resource. + * @return the {@link SyncPoller} for polling of data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, FarmBeatsInner> beginUpdate(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsUpdateRequestModel body); + SyncPoller, DataManagerForAgricultureInner> beginUpdate( + String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request); /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of farmBeats ARM Resource. + * @return the {@link SyncPoller} for polling of data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, FarmBeatsInner> beginUpdate(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, Context context); + SyncPoller, DataManagerForAgricultureInner> beginUpdate( + String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request, Context context); /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats ARM Resource. + * @return data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - FarmBeatsInner update(String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body); + DataManagerForAgricultureInner update(String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request); /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @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 farmBeats ARM Resource. + * @return data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - FarmBeatsInner update(String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, - Context context); + DataManagerForAgricultureInner update(String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request, Context context); /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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. @@ -149,22 +154,23 @@ FarmBeatsInner update(String resourceGroupName, String farmBeatsResourceName, Fa * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, Context context); + Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + Context context); /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeatsResourceName); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName); /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -172,10 +178,10 @@ FarmBeatsInner update(String resourceGroupName, String farmBeatsResourceName, Fa * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -188,10 +194,10 @@ FarmBeatsInner update(String resourceGroupName, String farmBeatsResourceName, Fa * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Integer maxPageSize, String skipToken, Context context); + PagedIterable list(Integer maxPageSize, String skipToken, Context context); /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -201,10 +207,10 @@ FarmBeatsInner update(String resourceGroupName, String farmBeatsResourceName, Fa * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param maxPageSize Maximum number of items needed (inclusive). @@ -218,6 +224,6 @@ FarmBeatsInner update(String resourceGroupName, String farmBeatsResourceName, Fa * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Integer maxPageSize, String skipToken, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Integer maxPageSize, + String skipToken, Context context); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/ExtensionsClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/ExtensionsClient.java index 38b5ecb5962c..2b9ad1d1ad14 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/ExtensionsClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/ExtensionsClient.java @@ -18,11 +18,11 @@ */ public interface ExtensionsClient { /** - * Install or Update extension. AdditionalApiProperties are merged patch and if the extension is updated to a new - * version then the obsolete entries will be auto deleted from AdditionalApiProperties. + * Install or Update extension. Additional Api Properties are merged patch and if the extension is updated to a new + * version then the obsolete entries will be auto deleted from Additional Api Properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param requestBody Extension resource request body. * @param context The context to associate with this operation. @@ -32,15 +32,16 @@ public interface ExtensionsClient { * @return extension resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String farmBeatsResourceName, - String extensionId, ExtensionInstallationRequest requestBody, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId, ExtensionInstallationRequest requestBody, + Context context); /** - * Install or Update extension. AdditionalApiProperties are merged patch and if the extension is updated to a new - * version then the obsolete entries will be auto deleted from AdditionalApiProperties. + * Install or Update extension. Additional Api Properties are merged patch and if the extension is updated to a new + * version then the obsolete entries will be auto deleted from Additional Api Properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -48,13 +49,14 @@ Response createOrUpdateWithResponse(String resourceGroupName, St * @return extension resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, String extensionId); + ExtensionInner createOrUpdate(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId); /** * Get installed extension details by extension id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,14 +65,14 @@ Response createOrUpdateWithResponse(String resourceGroupName, St * @return installed extension details by extension id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, String extensionId, - Context context); + Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context); /** * Get installed extension details by extension id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -78,13 +80,13 @@ Response getWithResponse(String resourceGroupName, String farmBe * @return installed extension details by extension id. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner get(String resourceGroupName, String farmBeatsResourceName, String extensionId); + ExtensionInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId); /** * Uninstall extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -93,40 +95,41 @@ Response getWithResponse(String resourceGroupName, String farmBe * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, String extensionId, - Context context); + Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context); /** * Uninstall extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String farmBeatsResourceName, String extensionId); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId); /** * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 installed extensions details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName); + PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName); /** * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionIds Installed extension ids. * @param extensionCategories Installed extension categories. * @param maxPageSize Maximum number of items needed (inclusive). @@ -139,7 +142,7 @@ Response deleteWithResponse(String resourceGroupName, String farmBeatsReso * @return installed extensions details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName, - List extensionIds, List extensionCategories, Integer maxPageSize, String skipToken, - Context context); + PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken, Context context); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/OperationResultsClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/OperationResultsClient.java index d40c4238a292..8251f61a5a69 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/OperationResultsClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/OperationResultsClient.java @@ -15,28 +15,28 @@ */ public interface OperationResultsClient { /** - * Get operationResults for a FarmBeats resource. + * Get operationResults for a Data Manager For Agriculture resource. * * @param locations Location. - * @param operationResultsId operation Results Id. + * @param operationResultsId operationResultsId for a specific location. * @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 operationResults for a FarmBeats resource along with {@link Response}. + * @return operationResults for a Data Manager For Agriculture resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String locations, String operationResultsId, Context context); /** - * Get operationResults for a FarmBeats resource. + * Get operationResults for a Data Manager For Agriculture resource. * * @param locations Location. - * @param operationResultsId operation Results Id. + * @param operationResultsId operationResultsId for a specific location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operationResults for a FarmBeats resource. + * @return operationResults for a Data Manager For Agriculture resource. */ @ServiceMethod(returns = ReturnType.SINGLE) ArmAsyncOperationInner get(String locations, String operationResultsId); diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/PrivateEndpointConnectionsClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/PrivateEndpointConnectionsClient.java index 54ed48a307ba..79115146fe70 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/PrivateEndpointConnectionsClient.java @@ -6,12 +6,12 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionListResultInner; /** * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. @@ -21,41 +21,46 @@ public interface PrivateEndpointConnectionsClient { * Approves or Rejects a Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. - * @param body Request object. + * @param request Request object. * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner body, - Context context); + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, Context context); /** * Approves or Rejects a Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. - * @param body Request object. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner body); + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner request); /** * Get Private endpoint connection object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -66,14 +71,14 @@ PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String f * @return private endpoint connection object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName, Context context); + Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context); /** * Get Private endpoint connection object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -83,14 +88,14 @@ Response getWithResponse(String resourceGroupNam * @return private endpoint connection object. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get(String resourceGroupName, String farmBeatsResourceName, + PrivateEndpointConnectionInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, String privateEndpointConnectionName); /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -98,14 +103,14 @@ PrivateEndpointConnectionInner get(String resourceGroupName, String farmBeatsRes * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName); + SyncPoller, Void> beginDelete(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName); /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -114,27 +119,28 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context); /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection 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 farmBeatsResourceName, String privateEndpointConnectionName); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName); /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,35 +148,35 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, - Context context); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName, Context context); /** * Get list of Private endpoint connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private endpoint connections as paginated response with {@link PagedIterable}. + * @return list of Private endpoint connections along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResource(String resourceGroupName, - String farmBeatsResourceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByResourceWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context); /** * Get list of Private endpoint connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param context The context to associate with this operation. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private endpoint connections as paginated response with {@link PagedIterable}. + * @return list of Private endpoint connections. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionListResultInner listByResource(String resourceGroupName, + String dataManagerForAgricultureResourceName); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/PrivateLinkResourcesClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/PrivateLinkResourcesClient.java index be09f60a34a9..31e2c366c2ab 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/PrivateLinkResourcesClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/PrivateLinkResourcesClient.java @@ -6,10 +6,10 @@ 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.agrifood.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceListResultInner; /** * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. @@ -19,35 +19,36 @@ public interface PrivateLinkResourcesClient { * Get list of Private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private link resources as paginated response with {@link PagedIterable}. + * @return list of Private link resources along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByResourceWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context); /** * Get list of Private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param context The context to associate with this operation. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private link resources as paginated response with {@link PagedIterable}. + * @return list of Private link resources. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner listByResource(String resourceGroupName, + String dataManagerForAgricultureResourceName); /** * Get Private link resource object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param subResourceName Sub resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -58,14 +59,14 @@ PagedIterable listByResource(String resourceGroupName, * @return private link resource object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, - String subResourceName, Context context); + Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String subResourceName, Context context); /** * Get Private link resource object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param subResourceName Sub resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -75,5 +76,6 @@ Response getWithResponse(String resourceGroupName, Str * @return private link resource object. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner get(String resourceGroupName, String farmBeatsResourceName, String subResourceName); + PrivateLinkResourceInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String subResourceName); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsClient.java index f12554efc0a1..14580400797a 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsClient.java @@ -10,7 +10,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.agrifood.fluent.models.SolutionInner; -import com.azure.resourcemanager.agrifood.models.SolutionInstallationRequest; import java.time.OffsetDateTime; import java.util.List; @@ -22,9 +21,9 @@ public interface SolutionsClient { * Install Or Update Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. - * @param body Solution resource request body. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. + * @param requestBody Solution resource request body. * @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. @@ -32,29 +31,30 @@ public interface SolutionsClient { * @return solution resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String farmBeatsResourceName, - String solutionId, SolutionInstallationRequest body, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String solutionId, SolutionInner requestBody, Context context); /** * Install Or Update Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return solution resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SolutionInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, String solutionId); + SolutionInner createOrUpdate(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId); /** * Get installed Solution details by Solution id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -62,29 +62,29 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * @return installed Solution details by Solution id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, String solutionId, - Context context); + Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId, Context context); /** * Get installed Solution details by Solution id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return installed Solution details by Solution id. */ @ServiceMethod(returns = ReturnType.SINGLE) - SolutionInner get(String resourceGroupName, String farmBeatsResourceName, String solutionId); + SolutionInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, String solutionId); /** * Uninstall Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -92,40 +92,40 @@ Response getWithResponse(String resourceGroupName, String farmBea * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, String solutionId, - Context context); + Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId, Context context); /** * Uninstall Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String farmBeatsResourceName, String solutionId); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String solutionId); /** * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 installed Solutions details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String farmBeatsResourceName); + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName); /** * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param solutionIds Installed Solution ids. * @param ids Ids of the resource. * @param names Names of the resource. @@ -146,8 +146,9 @@ Response deleteWithResponse(String resourceGroupName, String farmBeatsReso * @return installed Solutions details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String farmBeatsResourceName, List solutionIds, - List ids, List names, List propertyFilters, List statuses, - OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, OffsetDateTime minLastModifiedDateTime, - OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, String skipToken, Context context); + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName, + List solutionIds, List ids, List names, List propertyFilters, + List statuses, OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, + OffsetDateTime minLastModifiedDateTime, OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, + String skipToken, Context context); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsDiscoverabilitiesClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsDiscoverabilitiesClient.java index cbd9f8030d9b..fac86472c868 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsDiscoverabilitiesClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsDiscoverabilitiesClient.java @@ -9,7 +9,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsSolutionInner; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureSolutionInner; import java.util.List; /** @@ -17,54 +17,56 @@ */ public interface SolutionsDiscoverabilitiesClient { /** - * Get list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Get list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * - * @param farmBeatsSolutionIds Ids of FarmBeats Solutions which the customer requests to fetch. - * @param farmBeatsSolutionNames Names of FarmBeats Solutions which the customer requests to fetch. + * @param farmBeatsSolutionIds Ids of Data Manager For Agriculture Solutions which the customer requests to fetch. + * @param farmBeatsSolutionNames Names of Data Manager For Agriculture Solutions which the customer requests to + * fetch. * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(List farmBeatsSolutionIds, List farmBeatsSolutionNames, - Integer maxPageSize, Context context); + PagedIterable list(List farmBeatsSolutionIds, + List farmBeatsSolutionNames, Integer maxPageSize, Context context); /** - * Get farmBeats solution by id. + * Get Data Manager For Agriculture solution by id. * - * @param farmBeatsSolutionId farmBeatsSolutionId to be queried. + * @param dataManagerForAgricultureSolutionId dataManagerForAgricultureSolutionId to be queried. * @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 farmBeats solution by id along with {@link Response}. + * @return data Manager For Agriculture solution by id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String farmBeatsSolutionId, Context context); + Response getWithResponse(String dataManagerForAgricultureSolutionId, + Context context); /** - * Get farmBeats solution by id. + * Get Data Manager For Agriculture solution by id. * - * @param farmBeatsSolutionId farmBeatsSolutionId to be queried. + * @param dataManagerForAgricultureSolutionId dataManagerForAgricultureSolutionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats solution by id. + * @return data Manager For Agriculture solution by id. */ @ServiceMethod(returns = ReturnType.SINGLE) - FarmBeatsSolutionInner get(String farmBeatsSolutionId); + DataManagerForAgricultureSolutionInner get(String dataManagerForAgricultureSolutionId); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataConnectorInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataConnectorInner.java new file mode 100644 index 000000000000..d75d76ae3f58 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataConnectorInner.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.agrifood.models.DataConnectorProperties; +import java.io.IOException; + +/** + * DataConnector Model. + */ +@Fluent +public final class DataConnectorInner extends ProxyResource { + /* + * DataConnector Properties. + */ + private DataConnectorProperties properties; + + /* + * The ETag value to implement optimistic concurrency. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DataConnectorInner class. + */ + public DataConnectorInner() { + } + + /** + * Get the properties property: DataConnector Properties. + * + * @return the properties value. + */ + public DataConnectorProperties properties() { + return this.properties; + } + + /** + * Set the properties property: DataConnector Properties. + * + * @param properties the properties value to set. + * @return the DataConnectorInner object itself. + */ + public DataConnectorInner withProperties(DataConnectorProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: The ETag value to implement optimistic concurrency. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model DataConnectorInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataConnectorInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectorInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataConnectorInner. + */ + public static DataConnectorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectorInner deserializedDataConnectorInner = new DataConnectorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataConnectorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataConnectorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataConnectorInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDataConnectorInner.properties = DataConnectorProperties.fromJson(reader); + } else if ("eTag".equals(fieldName)) { + deserializedDataConnectorInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedDataConnectorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataConnectorInner; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureExtensionInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureExtensionInner.java new file mode 100644 index 000000000000..da5541ab1a1f --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureExtensionInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureExtensionProperties; +import java.io.IOException; + +/** + * DataManagerForAgriculture extension resource. + */ +@Fluent +public final class DataManagerForAgricultureExtensionInner extends ProxyResource { + /* + * DataManagerForAgricultureExtension properties. + */ + private DataManagerForAgricultureExtensionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DataManagerForAgricultureExtensionInner class. + */ + public DataManagerForAgricultureExtensionInner() { + } + + /** + * Get the properties property: DataManagerForAgricultureExtension properties. + * + * @return the properties value. + */ + public DataManagerForAgricultureExtensionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: DataManagerForAgricultureExtension properties. + * + * @param properties the properties value to set. + * @return the DataManagerForAgricultureExtensionInner object itself. + */ + public DataManagerForAgricultureExtensionInner + withProperties(DataManagerForAgricultureExtensionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataManagerForAgricultureExtensionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataManagerForAgricultureExtensionInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureExtensionInner. + */ + public static DataManagerForAgricultureExtensionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataManagerForAgricultureExtensionInner deserializedDataManagerForAgricultureExtensionInner + = new DataManagerForAgricultureExtensionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataManagerForAgricultureExtensionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataManagerForAgricultureExtensionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataManagerForAgricultureExtensionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDataManagerForAgricultureExtensionInner.properties + = DataManagerForAgricultureExtensionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataManagerForAgricultureExtensionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataManagerForAgricultureExtensionInner; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureInner.java similarity index 67% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsInner.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureInner.java index b4dce0a1e862..a65dda4fe0fa 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsInner.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureInner.java @@ -15,22 +15,23 @@ import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; import com.azure.resourcemanager.agrifood.models.SensorIntegration; import java.io.IOException; +import java.util.List; import java.util.Map; /** - * FarmBeats ARM Resource. + * Data Manager For Agriculture ARM Resource. */ @Fluent -public final class FarmBeatsInner extends Resource { +public final class DataManagerForAgricultureInner extends Resource { /* * Identity for the resource. */ private Identity identity; /* - * FarmBeats ARM Resource properties. + * Data Manager For Agriculture ARM Resource properties. */ - private FarmBeatsPropertiesInner innerProperties; + private DataManagerForAgricultureProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -53,9 +54,9 @@ public final class FarmBeatsInner extends Resource { private String id; /** - * Creates an instance of FarmBeatsInner class. + * Creates an instance of DataManagerForAgricultureInner class. */ - public FarmBeatsInner() { + public DataManagerForAgricultureInner() { } /** @@ -71,19 +72,19 @@ public Identity identity() { * Set the identity property: Identity for the resource. * * @param identity the identity value to set. - * @return the FarmBeatsInner object itself. + * @return the DataManagerForAgricultureInner object itself. */ - public FarmBeatsInner withIdentity(Identity identity) { + public DataManagerForAgricultureInner withIdentity(Identity identity) { this.identity = identity; return this; } /** - * Get the innerProperties property: FarmBeats ARM Resource properties. + * Get the innerProperties property: Data Manager For Agriculture ARM Resource properties. * * @return the innerProperties value. */ - private FarmBeatsPropertiesInner innerProperties() { + private DataManagerForAgricultureProperties innerProperties() { return this.innerProperties; } @@ -130,7 +131,7 @@ public String id() { * {@inheritDoc} */ @Override - public FarmBeatsInner withLocation(String location) { + public DataManagerForAgricultureInner withLocation(String location) { super.withLocation(location); return this; } @@ -139,13 +140,13 @@ public FarmBeatsInner withLocation(String location) { * {@inheritDoc} */ @Override - public FarmBeatsInner withTags(Map tags) { + public DataManagerForAgricultureInner withTags(Map tags) { super.withTags(tags); return this; } /** - * Get the instanceUri property: Uri of the FarmBeats instance. + * Get the instanceUri property: Uri of the Data Manager For Agriculture instance. * * @return the instanceUri value. */ @@ -154,7 +155,7 @@ public String instanceUri() { } /** - * Get the provisioningState property: FarmBeats instance provisioning state. + * Get the provisioningState property: Data Manager For Agriculture instance provisioning state. * * @return the provisioningState value. */ @@ -175,18 +176,19 @@ public SensorIntegration sensorIntegration() { * Set the sensorIntegration property: Sensor integration request model. * * @param sensorIntegration the sensorIntegration value to set. - * @return the FarmBeatsInner object itself. + * @return the DataManagerForAgricultureInner object itself. */ - public FarmBeatsInner withSensorIntegration(SensorIntegration sensorIntegration) { + public DataManagerForAgricultureInner withSensorIntegration(SensorIntegration sensorIntegration) { if (this.innerProperties() == null) { - this.innerProperties = new FarmBeatsPropertiesInner(); + this.innerProperties = new DataManagerForAgricultureProperties(); } this.innerProperties().withSensorIntegration(sensorIntegration); return this; } /** - * Get the publicNetworkAccess property: Property to allow or block public traffic for an Azure FarmBeats resource. + * Get the publicNetworkAccess property: Property to allow or block public traffic for an Azure Data Manager For + * Agriculture resource. * * @return the publicNetworkAccess value. */ @@ -195,25 +197,26 @@ public PublicNetworkAccess publicNetworkAccess() { } /** - * Set the publicNetworkAccess property: Property to allow or block public traffic for an Azure FarmBeats resource. + * Set the publicNetworkAccess property: Property to allow or block public traffic for an Azure Data Manager For + * Agriculture resource. * * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the FarmBeatsInner object itself. + * @return the DataManagerForAgricultureInner object itself. */ - public FarmBeatsInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + public DataManagerForAgricultureInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { if (this.innerProperties() == null) { - this.innerProperties = new FarmBeatsPropertiesInner(); + this.innerProperties = new DataManagerForAgricultureProperties(); } this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); return this; } /** - * Get the privateEndpointConnections property: The private endpoint connection resource. + * Get the privateEndpointConnections property: Private endpoints. * * @return the privateEndpointConnections value. */ - public PrivateEndpointConnectionInner privateEndpointConnections() { + public List privateEndpointConnections() { return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } @@ -245,44 +248,46 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FarmBeatsInner from the JsonReader. + * Reads an instance of DataManagerForAgricultureInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of DataManagerForAgricultureInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FarmBeatsInner. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureInner. */ - public static FarmBeatsInner fromJson(JsonReader jsonReader) throws IOException { + public static DataManagerForAgricultureInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FarmBeatsInner deserializedFarmBeatsInner = new FarmBeatsInner(); + DataManagerForAgricultureInner deserializedDataManagerForAgricultureInner + = new DataManagerForAgricultureInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedFarmBeatsInner.id = reader.getString(); + deserializedDataManagerForAgricultureInner.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedFarmBeatsInner.name = reader.getString(); + deserializedDataManagerForAgricultureInner.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedFarmBeatsInner.type = reader.getString(); + deserializedDataManagerForAgricultureInner.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedFarmBeatsInner.withLocation(reader.getString()); + deserializedDataManagerForAgricultureInner.withLocation(reader.getString()); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedFarmBeatsInner.withTags(tags); + deserializedDataManagerForAgricultureInner.withTags(tags); } else if ("identity".equals(fieldName)) { - deserializedFarmBeatsInner.identity = Identity.fromJson(reader); + deserializedDataManagerForAgricultureInner.identity = Identity.fromJson(reader); } else if ("properties".equals(fieldName)) { - deserializedFarmBeatsInner.innerProperties = FarmBeatsPropertiesInner.fromJson(reader); + deserializedDataManagerForAgricultureInner.innerProperties + = DataManagerForAgricultureProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedFarmBeatsInner.systemData = SystemData.fromJson(reader); + deserializedDataManagerForAgricultureInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedFarmBeatsInner; + return deserializedDataManagerForAgricultureInner; }); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsPropertiesInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureProperties.java similarity index 58% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsPropertiesInner.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureProperties.java index 749058d3c265..f33d7a10d115 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsPropertiesInner.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureProperties.java @@ -13,19 +13,21 @@ import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; import com.azure.resourcemanager.agrifood.models.SensorIntegration; import java.io.IOException; +import java.util.List; /** - * FarmBeats ARM Resource properties. + * Data Manager For Agriculture ARM Resource properties. */ @Fluent -public final class FarmBeatsPropertiesInner implements JsonSerializable { +public final class DataManagerForAgricultureProperties + implements JsonSerializable { /* - * Uri of the FarmBeats instance. + * Uri of the Data Manager For Agriculture instance. */ private String instanceUri; /* - * FarmBeats instance provisioning state. + * Data Manager For Agriculture instance provisioning state. */ private ProvisioningState provisioningState; @@ -35,23 +37,23 @@ public final class FarmBeatsPropertiesInner implements JsonSerializable privateEndpointConnections; /** - * Creates an instance of FarmBeatsPropertiesInner class. + * Creates an instance of DataManagerForAgricultureProperties class. */ - public FarmBeatsPropertiesInner() { + public DataManagerForAgricultureProperties() { } /** - * Get the instanceUri property: Uri of the FarmBeats instance. + * Get the instanceUri property: Uri of the Data Manager For Agriculture instance. * * @return the instanceUri value. */ @@ -60,7 +62,7 @@ public String instanceUri() { } /** - * Get the provisioningState property: FarmBeats instance provisioning state. + * Get the provisioningState property: Data Manager For Agriculture instance provisioning state. * * @return the provisioningState value. */ @@ -81,15 +83,16 @@ public SensorIntegration sensorIntegration() { * Set the sensorIntegration property: Sensor integration request model. * * @param sensorIntegration the sensorIntegration value to set. - * @return the FarmBeatsPropertiesInner object itself. + * @return the DataManagerForAgricultureProperties object itself. */ - public FarmBeatsPropertiesInner withSensorIntegration(SensorIntegration sensorIntegration) { + public DataManagerForAgricultureProperties withSensorIntegration(SensorIntegration sensorIntegration) { this.sensorIntegration = sensorIntegration; return this; } /** - * Get the publicNetworkAccess property: Property to allow or block public traffic for an Azure FarmBeats resource. + * Get the publicNetworkAccess property: Property to allow or block public traffic for an Azure Data Manager For + * Agriculture resource. * * @return the publicNetworkAccess value. */ @@ -98,22 +101,23 @@ public PublicNetworkAccess publicNetworkAccess() { } /** - * Set the publicNetworkAccess property: Property to allow or block public traffic for an Azure FarmBeats resource. + * Set the publicNetworkAccess property: Property to allow or block public traffic for an Azure Data Manager For + * Agriculture resource. * * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the FarmBeatsPropertiesInner object itself. + * @return the DataManagerForAgricultureProperties object itself. */ - public FarmBeatsPropertiesInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + public DataManagerForAgricultureProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { this.publicNetworkAccess = publicNetworkAccess; return this; } /** - * Get the privateEndpointConnections property: The private endpoint connection resource. + * Get the privateEndpointConnections property: Private endpoints. * * @return the privateEndpointConnections value. */ - public PrivateEndpointConnectionInner privateEndpointConnections() { + public List privateEndpointConnections() { return this.privateEndpointConnections; } @@ -127,7 +131,7 @@ public void validate() { sensorIntegration().validate(); } if (privateEndpointConnections() != null) { - privateEndpointConnections().validate(); + privateEndpointConnections().forEach(e -> e.validate()); } } @@ -144,39 +148,43 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FarmBeatsPropertiesInner from the JsonReader. + * Reads an instance of DataManagerForAgricultureProperties from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsPropertiesInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the FarmBeatsPropertiesInner. + * @return An instance of DataManagerForAgricultureProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureProperties. */ - public static FarmBeatsPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + public static DataManagerForAgricultureProperties fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FarmBeatsPropertiesInner deserializedFarmBeatsPropertiesInner = new FarmBeatsPropertiesInner(); + DataManagerForAgricultureProperties deserializedDataManagerForAgricultureProperties + = new DataManagerForAgricultureProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("instanceUri".equals(fieldName)) { - deserializedFarmBeatsPropertiesInner.instanceUri = reader.getString(); + deserializedDataManagerForAgricultureProperties.instanceUri = reader.getString(); } else if ("provisioningState".equals(fieldName)) { - deserializedFarmBeatsPropertiesInner.provisioningState + deserializedDataManagerForAgricultureProperties.provisioningState = ProvisioningState.fromString(reader.getString()); } else if ("sensorIntegration".equals(fieldName)) { - deserializedFarmBeatsPropertiesInner.sensorIntegration = SensorIntegration.fromJson(reader); + deserializedDataManagerForAgricultureProperties.sensorIntegration + = SensorIntegration.fromJson(reader); } else if ("publicNetworkAccess".equals(fieldName)) { - deserializedFarmBeatsPropertiesInner.publicNetworkAccess + deserializedDataManagerForAgricultureProperties.publicNetworkAccess = PublicNetworkAccess.fromString(reader.getString()); } else if ("privateEndpointConnections".equals(fieldName)) { - deserializedFarmBeatsPropertiesInner.privateEndpointConnections - = PrivateEndpointConnectionInner.fromJson(reader); + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedDataManagerForAgricultureProperties.privateEndpointConnections + = privateEndpointConnections; } else { reader.skipChildren(); } } - return deserializedFarmBeatsPropertiesInner; + return deserializedDataManagerForAgricultureProperties; }); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsSolutionInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureSolutionInner.java similarity index 61% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsSolutionInner.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureSolutionInner.java index 872e601e206d..68f036987f8d 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsSolutionInner.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureSolutionInner.java @@ -10,18 +10,18 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.agrifood.models.FarmBeatsSolutionProperties; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureSolutionProperties; import java.io.IOException; /** - * FarmBeats solution resource. + * DataManagerForAgriculture solution resource. */ @Fluent -public final class FarmBeatsSolutionInner extends ProxyResource { +public final class DataManagerForAgricultureSolutionInner extends ProxyResource { /* - * FarmBeatsSolution properties. + * DataManagerForAgricultureSolution properties. */ - private FarmBeatsSolutionProperties properties; + private DataManagerForAgricultureSolutionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -44,27 +44,28 @@ public final class FarmBeatsSolutionInner extends ProxyResource { private String id; /** - * Creates an instance of FarmBeatsSolutionInner class. + * Creates an instance of DataManagerForAgricultureSolutionInner class. */ - public FarmBeatsSolutionInner() { + public DataManagerForAgricultureSolutionInner() { } /** - * Get the properties property: FarmBeatsSolution properties. + * Get the properties property: DataManagerForAgricultureSolution properties. * * @return the properties value. */ - public FarmBeatsSolutionProperties properties() { + public DataManagerForAgricultureSolutionProperties properties() { return this.properties; } /** - * Set the properties property: FarmBeatsSolution properties. + * Set the properties property: DataManagerForAgricultureSolution properties. * * @param properties the properties value to set. - * @return the FarmBeatsSolutionInner object itself. + * @return the DataManagerForAgricultureSolutionInner object itself. */ - public FarmBeatsSolutionInner withProperties(FarmBeatsSolutionProperties properties) { + public DataManagerForAgricultureSolutionInner + withProperties(DataManagerForAgricultureSolutionProperties properties) { this.properties = properties; return this; } @@ -130,37 +131,39 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FarmBeatsSolutionInner from the JsonReader. + * Reads an instance of DataManagerForAgricultureSolutionInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsSolutionInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of DataManagerForAgricultureSolutionInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FarmBeatsSolutionInner. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureSolutionInner. */ - public static FarmBeatsSolutionInner fromJson(JsonReader jsonReader) throws IOException { + public static DataManagerForAgricultureSolutionInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FarmBeatsSolutionInner deserializedFarmBeatsSolutionInner = new FarmBeatsSolutionInner(); + DataManagerForAgricultureSolutionInner deserializedDataManagerForAgricultureSolutionInner + = new DataManagerForAgricultureSolutionInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedFarmBeatsSolutionInner.id = reader.getString(); + deserializedDataManagerForAgricultureSolutionInner.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedFarmBeatsSolutionInner.name = reader.getString(); + deserializedDataManagerForAgricultureSolutionInner.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedFarmBeatsSolutionInner.type = reader.getString(); + deserializedDataManagerForAgricultureSolutionInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedFarmBeatsSolutionInner.properties = FarmBeatsSolutionProperties.fromJson(reader); + deserializedDataManagerForAgricultureSolutionInner.properties + = DataManagerForAgricultureSolutionProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedFarmBeatsSolutionInner.systemData = SystemData.fromJson(reader); + deserializedDataManagerForAgricultureSolutionInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedFarmBeatsSolutionInner; + return deserializedDataManagerForAgricultureSolutionInner; }); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ExtensionInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ExtensionInner.java index ee4b719c014f..87085cec6b73 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ExtensionInner.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ExtensionInner.java @@ -158,7 +158,7 @@ public String extensionApiDocsLink() { } /** - * Get the additionalApiProperties property: Additional api properties. + * Get the additionalApiProperties property: Additional Api Properties. * * @return the additionalApiProperties value. */ diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ExtensionProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ExtensionProperties.java index 5bb773cec007..1978d6c298ff 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ExtensionProperties.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ExtensionProperties.java @@ -44,7 +44,7 @@ public final class ExtensionProperties implements JsonSerializable additionalApiProperties; @@ -100,7 +100,7 @@ public String extensionApiDocsLink() { } /** - * Get the additionalApiProperties property: Additional api properties. + * Get the additionalApiProperties property: Additional Api Properties. * * @return the additionalApiProperties value. */ diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsExtensionInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsExtensionInner.java deleted file mode 100644 index a43cab1f3110..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsExtensionInner.java +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.agrifood.models.DetailedInformation; -import java.io.IOException; -import java.util.List; - -/** - * FarmBeats extension resource. - */ -@Immutable -public final class FarmBeatsExtensionInner extends ProxyResource { - /* - * FarmBeatsExtension properties. - */ - private FarmBeatsExtensionProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of FarmBeatsExtensionInner class. - */ - public FarmBeatsExtensionInner() { - } - - /** - * Get the innerProperties property: FarmBeatsExtension properties. - * - * @return the innerProperties value. - */ - private FarmBeatsExtensionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the targetResourceType property: Target ResourceType of the farmBeatsExtension. - * - * @return the targetResourceType value. - */ - public String targetResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().targetResourceType(); - } - - /** - * Get the farmBeatsExtensionId property: FarmBeatsExtension ID. - * - * @return the farmBeatsExtensionId value. - */ - public String farmBeatsExtensionId() { - return this.innerProperties() == null ? null : this.innerProperties().farmBeatsExtensionId(); - } - - /** - * Get the farmBeatsExtensionName property: FarmBeatsExtension name. - * - * @return the farmBeatsExtensionName value. - */ - public String farmBeatsExtensionName() { - return this.innerProperties() == null ? null : this.innerProperties().farmBeatsExtensionName(); - } - - /** - * Get the farmBeatsExtensionVersion property: FarmBeatsExtension version. - * - * @return the farmBeatsExtensionVersion value. - */ - public String farmBeatsExtensionVersion() { - return this.innerProperties() == null ? null : this.innerProperties().farmBeatsExtensionVersion(); - } - - /** - * Get the publisherId property: Publisher ID. - * - * @return the publisherId value. - */ - public String publisherId() { - return this.innerProperties() == null ? null : this.innerProperties().publisherId(); - } - - /** - * Get the description property: Textual description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the extensionCategory property: Category of the extension. e.g. weather/sensor/satellite. - * - * @return the extensionCategory value. - */ - public String extensionCategory() { - return this.innerProperties() == null ? null : this.innerProperties().extensionCategory(); - } - - /** - * Get the extensionAuthLink property: FarmBeatsExtension auth link. - * - * @return the extensionAuthLink value. - */ - public String extensionAuthLink() { - return this.innerProperties() == null ? null : this.innerProperties().extensionAuthLink(); - } - - /** - * Get the extensionApiDocsLink property: FarmBeatsExtension api docs link. - * - * @return the extensionApiDocsLink value. - */ - public String extensionApiDocsLink() { - return this.innerProperties() == null ? null : this.innerProperties().extensionApiDocsLink(); - } - - /** - * Get the detailedInformation property: Detailed information which shows summary of requested data. - * Used in descriptive get extension metadata call. - * Information for weather category per api included are apisSupported, - * customParameters, PlatformParameters and Units supported. - * - * @return the detailedInformation value. - */ - public List detailedInformation() { - return this.innerProperties() == null ? null : this.innerProperties().detailedInformation(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FarmBeatsExtensionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsExtensionInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FarmBeatsExtensionInner. - */ - public static FarmBeatsExtensionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FarmBeatsExtensionInner deserializedFarmBeatsExtensionInner = new FarmBeatsExtensionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedFarmBeatsExtensionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedFarmBeatsExtensionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedFarmBeatsExtensionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedFarmBeatsExtensionInner.innerProperties = FarmBeatsExtensionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedFarmBeatsExtensionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedFarmBeatsExtensionInner; - }); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionListResultInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionListResultInner.java new file mode 100644 index 000000000000..fd48101bc404 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionListResultInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of private endpoint connections associated with the specified resource. + */ +@Fluent +public final class PrivateEndpointConnectionListResultInner + implements JsonSerializable { + /* + * Array of private endpoint connections. + */ + private List value; + + /** + * Creates an instance of PrivateEndpointConnectionListResultInner class. + */ + public PrivateEndpointConnectionListResultInner() { + } + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResultInner object itself. + */ + public PrivateEndpointConnectionListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResultInner. + */ + public static PrivateEndpointConnectionListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResultInner deserializedPrivateEndpointConnectionListResultInner + = new PrivateEndpointConnectionListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResultInner; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 000000000000..fdfb290b3821 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A list of private link resources. + */ +@Fluent +public final class PrivateLinkResourceListResultInner implements JsonSerializable { + /* + * Array of private link resources + */ + private List value; + + /** + * Creates an instance of PrivateLinkResourceListResultInner class. + */ + public PrivateLinkResourceListResultInner() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceListResultInner. + */ + public static PrivateLinkResourceListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResultInner deserializedPrivateLinkResourceListResultInner + = new PrivateLinkResourceListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResultInner; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/package-info.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/package-info.java index 9ab6e85c983f..3e7df8ab030b 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/package-info.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the inner data models for AgriFoodManagementClient. - * APIs documentation for Azure AgFoodPlatform Resource Provider Service. + * APIs documentation for Microsoft Azure Data Manager for Agriculture Service. */ package com.azure.resourcemanager.agrifood.fluent.models; diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/package-info.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/package-info.java index ed1f4d5f62cc..1a4041bcaebb 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/package-info.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the service clients for AgriFoodManagementClient. - * APIs documentation for Azure AgFoodPlatform Resource Provider Service. + * APIs documentation for Microsoft Azure Data Manager for Agriculture Service. */ package com.azure.resourcemanager.agrifood.fluent; diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/AgriFoodManagementClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/AgriFoodManagementClientImpl.java index 5fa02601b3ca..c1be32014ceb 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/AgriFoodManagementClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/AgriFoodManagementClientImpl.java @@ -24,10 +24,11 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.agrifood.fluent.AgriFoodManagementClient; +import com.azure.resourcemanager.agrifood.fluent.CheckNameAvailabilitiesClient; +import com.azure.resourcemanager.agrifood.fluent.DataConnectorsClient; +import com.azure.resourcemanager.agrifood.fluent.DataManagerForAgricultureExtensionsClient; +import com.azure.resourcemanager.agrifood.fluent.DataManagerForAgricultureResourcesClient; import com.azure.resourcemanager.agrifood.fluent.ExtensionsClient; -import com.azure.resourcemanager.agrifood.fluent.FarmBeatsExtensionsClient; -import com.azure.resourcemanager.agrifood.fluent.FarmBeatsModelsClient; -import com.azure.resourcemanager.agrifood.fluent.LocationsClient; import com.azure.resourcemanager.agrifood.fluent.OperationResultsClient; import com.azure.resourcemanager.agrifood.fluent.OperationsClient; import com.azure.resourcemanager.agrifood.fluent.PrivateEndpointConnectionsClient; @@ -133,45 +134,59 @@ public Duration getDefaultPollInterval() { } /** - * The ExtensionsClient object to access its operations. + * The CheckNameAvailabilitiesClient object to access its operations. */ - private final ExtensionsClient extensions; + private final CheckNameAvailabilitiesClient checkNameAvailabilities; /** - * Gets the ExtensionsClient object to access its operations. + * Gets the CheckNameAvailabilitiesClient object to access its operations. * - * @return the ExtensionsClient object. + * @return the CheckNameAvailabilitiesClient object. */ - public ExtensionsClient getExtensions() { - return this.extensions; + public CheckNameAvailabilitiesClient getCheckNameAvailabilities() { + return this.checkNameAvailabilities; + } + + /** + * The DataConnectorsClient object to access its operations. + */ + private final DataConnectorsClient dataConnectors; + + /** + * Gets the DataConnectorsClient object to access its operations. + * + * @return the DataConnectorsClient object. + */ + public DataConnectorsClient getDataConnectors() { + return this.dataConnectors; } /** - * The FarmBeatsExtensionsClient object to access its operations. + * The DataManagerForAgricultureExtensionsClient object to access its operations. */ - private final FarmBeatsExtensionsClient farmBeatsExtensions; + private final DataManagerForAgricultureExtensionsClient dataManagerForAgricultureExtensions; /** - * Gets the FarmBeatsExtensionsClient object to access its operations. + * Gets the DataManagerForAgricultureExtensionsClient object to access its operations. * - * @return the FarmBeatsExtensionsClient object. + * @return the DataManagerForAgricultureExtensionsClient object. */ - public FarmBeatsExtensionsClient getFarmBeatsExtensions() { - return this.farmBeatsExtensions; + public DataManagerForAgricultureExtensionsClient getDataManagerForAgricultureExtensions() { + return this.dataManagerForAgricultureExtensions; } /** - * The FarmBeatsModelsClient object to access its operations. + * The DataManagerForAgricultureResourcesClient object to access its operations. */ - private final FarmBeatsModelsClient farmBeatsModels; + private final DataManagerForAgricultureResourcesClient dataManagerForAgricultureResources; /** - * Gets the FarmBeatsModelsClient object to access its operations. + * Gets the DataManagerForAgricultureResourcesClient object to access its operations. * - * @return the FarmBeatsModelsClient object. + * @return the DataManagerForAgricultureResourcesClient object. */ - public FarmBeatsModelsClient getFarmBeatsModels() { - return this.farmBeatsModels; + public DataManagerForAgricultureResourcesClient getDataManagerForAgricultureResources() { + return this.dataManagerForAgricultureResources; } /** @@ -189,17 +204,17 @@ public OperationResultsClient getOperationResults() { } /** - * The LocationsClient object to access its operations. + * The ExtensionsClient object to access its operations. */ - private final LocationsClient locations; + private final ExtensionsClient extensions; /** - * Gets the LocationsClient object to access its operations. + * Gets the ExtensionsClient object to access its operations. * - * @return the LocationsClient object. + * @return the ExtensionsClient object. */ - public LocationsClient getLocations() { - return this.locations; + public ExtensionsClient getExtensions() { + return this.extensions; } /** @@ -289,12 +304,13 @@ public SolutionsDiscoverabilitiesClient getSolutionsDiscoverabilities() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-09-01-preview"; - this.extensions = new ExtensionsClientImpl(this); - this.farmBeatsExtensions = new FarmBeatsExtensionsClientImpl(this); - this.farmBeatsModels = new FarmBeatsModelsClientImpl(this); + this.apiVersion = "2024-12-01-preview"; + this.checkNameAvailabilities = new CheckNameAvailabilitiesClientImpl(this); + this.dataConnectors = new DataConnectorsClientImpl(this); + this.dataManagerForAgricultureExtensions = new DataManagerForAgricultureExtensionsClientImpl(this); + this.dataManagerForAgricultureResources = new DataManagerForAgricultureResourcesClientImpl(this); this.operationResults = new OperationResultsClientImpl(this); - this.locations = new LocationsClientImpl(this); + this.extensions = new ExtensionsClientImpl(this); this.operations = new OperationsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/LocationsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/CheckNameAvailabilitiesClientImpl.java similarity index 73% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/LocationsClientImpl.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/CheckNameAvailabilitiesClientImpl.java index 42ae1f2ee33c..08aea2c8751e 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/LocationsClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/CheckNameAvailabilitiesClientImpl.java @@ -22,19 +22,19 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.agrifood.fluent.LocationsClient; +import com.azure.resourcemanager.agrifood.fluent.CheckNameAvailabilitiesClient; import com.azure.resourcemanager.agrifood.fluent.models.CheckNameAvailabilityResponseInner; import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in LocationsClient. + * An instance of this class provides access to all the operations defined in CheckNameAvailabilitiesClient. */ -public final class LocationsClientImpl implements LocationsClient { +public final class CheckNameAvailabilitiesClientImpl implements CheckNameAvailabilitiesClient { /** * The proxy service used to perform REST calls. */ - private final LocationsService service; + private final CheckNameAvailabilitiesService service; /** * The service client containing this operation class. @@ -42,37 +42,37 @@ public final class LocationsClientImpl implements LocationsClient { private final AgriFoodManagementClientImpl client; /** - * Initializes an instance of LocationsClientImpl. + * Initializes an instance of CheckNameAvailabilitiesClientImpl. * * @param client the instance of the service client containing this operation class. */ - LocationsClientImpl(AgriFoodManagementClientImpl client) { - this.service - = RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + CheckNameAvailabilitiesClientImpl(AgriFoodManagementClientImpl client) { + this.service = RestProxy.create(CheckNameAvailabilitiesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AgriFoodManagementClientLocations to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AgriFoodManagementClientCheckNameAvailabilities to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AgriFoodManagementCl") - public interface LocationsService { + public interface CheckNameAvailabilitiesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/checkNameAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkNameAvailability(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityRequest body, @HeaderParam("Accept") String accept, - Context context); + @BodyParam("application/json") CheckNameAvailabilityRequest nameAvailabilityRequest, + @HeaderParam("Accept") String accept, Context context); } /** * Checks the name availability of the resource with requested resource name. * - * @param body NameAvailabilityRequest object. + * @param nameAvailabilityRequest NameAvailabilityRequest object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -80,7 +80,7 @@ Mono> checkNameAvailability(@HostPa */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest body) { + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest nameAvailabilityRequest) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -89,22 +89,23 @@ Mono> checkNameAvailability(@HostPa return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (nameAvailabilityRequest == null) { + return Mono.error( + new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); } else { - body.validate(); + nameAvailabilityRequest.validate(); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), body, accept, context)) + this.client.getSubscriptionId(), this.client.getApiVersion(), nameAvailabilityRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Checks the name availability of the resource with requested resource name. * - * @param body NameAvailabilityRequest object. + * @param nameAvailabilityRequest NameAvailabilityRequest object. * @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. @@ -113,7 +114,7 @@ Mono> checkNameAvailability(@HostPa */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest body, Context context) { + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -122,35 +123,38 @@ Mono> checkNameAvailability(@HostPa return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (nameAvailabilityRequest == null) { + return Mono.error( + new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); } else { - body.validate(); + nameAvailabilityRequest.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), body, accept, context); + this.client.getApiVersion(), nameAvailabilityRequest, accept, context); } /** * Checks the name availability of the resource with requested resource name. * - * @param body NameAvailabilityRequest object. + * @param nameAvailabilityRequest NameAvailabilityRequest object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the check availability result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync(CheckNameAvailabilityRequest body) { - return checkNameAvailabilityWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono + checkNameAvailabilityAsync(CheckNameAvailabilityRequest nameAvailabilityRequest) { + return checkNameAvailabilityWithResponseAsync(nameAvailabilityRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Checks the name availability of the resource with requested resource name. * - * @param body NameAvailabilityRequest object. + * @param nameAvailabilityRequest NameAvailabilityRequest object. * @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. @@ -159,21 +163,22 @@ private Mono checkNameAvailabilityAsync(Chec */ @ServiceMethod(returns = ReturnType.SINGLE) public Response - checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body, Context context) { - return checkNameAvailabilityWithResponseAsync(body, context).block(); + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { + return checkNameAvailabilityWithResponseAsync(nameAvailabilityRequest, context).block(); } /** * Checks the name availability of the resource with requested resource name. * - * @param body NameAvailabilityRequest object. + * @param nameAvailabilityRequest NameAvailabilityRequest object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the check availability result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResponseInner checkNameAvailability(CheckNameAvailabilityRequest body) { - return checkNameAvailabilityWithResponse(body, Context.NONE).getValue(); + public CheckNameAvailabilityResponseInner + checkNameAvailability(CheckNameAvailabilityRequest nameAvailabilityRequest) { + return checkNameAvailabilityWithResponse(nameAvailabilityRequest, Context.NONE).getValue(); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/LocationsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/CheckNameAvailabilitiesImpl.java similarity index 69% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/LocationsImpl.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/CheckNameAvailabilitiesImpl.java index f375f81406f2..c6ddb791ad21 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/LocationsImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/CheckNameAvailabilitiesImpl.java @@ -8,29 +8,29 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.agrifood.fluent.LocationsClient; +import com.azure.resourcemanager.agrifood.fluent.CheckNameAvailabilitiesClient; import com.azure.resourcemanager.agrifood.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilities; import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityResponse; -import com.azure.resourcemanager.agrifood.models.Locations; -public final class LocationsImpl implements Locations { - private static final ClientLogger LOGGER = new ClientLogger(LocationsImpl.class); +public final class CheckNameAvailabilitiesImpl implements CheckNameAvailabilities { + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilitiesImpl.class); - private final LocationsClient innerClient; + private final CheckNameAvailabilitiesClient innerClient; private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - public LocationsImpl(LocationsClient innerClient, + public CheckNameAvailabilitiesImpl(CheckNameAvailabilitiesClient innerClient, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body, - Context context) { + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { Response inner - = this.serviceClient().checkNameAvailabilityWithResponse(body, context); + = this.serviceClient().checkNameAvailabilityWithResponse(nameAvailabilityRequest, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); @@ -39,8 +39,8 @@ public Response checkNameAvailabilityWithResponse } } - public CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest body) { - CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(body); + public CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest nameAvailabilityRequest) { + CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(nameAvailabilityRequest); if (inner != null) { return new CheckNameAvailabilityResponseImpl(inner, this.manager()); } else { @@ -48,7 +48,7 @@ public CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailability } } - private LocationsClient serviceClient() { + private CheckNameAvailabilitiesClient serviceClient() { return this.innerClient; } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorImpl.java new file mode 100644 index 000000000000..8241501c1528 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.agrifood.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.agrifood.models.DataConnector; +import com.azure.resourcemanager.agrifood.models.DataConnectorProperties; + +public final class DataConnectorImpl implements DataConnector, DataConnector.Definition, DataConnector.Update { + private DataConnectorInner innerObject; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DataConnectorProperties properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DataConnectorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String dataManagerForAgricultureResourceName; + + private String dataConnectorName; + + public DataConnectorImpl withExistingFarmBeat(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + this.resourceGroupName = resourceGroupName; + this.dataManagerForAgricultureResourceName = dataManagerForAgricultureResourceName; + return this; + } + + public DataConnector create() { + this.innerObject = serviceManager.serviceClient() + .getDataConnectors() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DataConnector create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDataConnectors() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + this.innerModel(), context) + .getValue(); + return this; + } + + DataConnectorImpl(String name, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerObject = new DataConnectorInner(); + this.serviceManager = serviceManager; + this.dataConnectorName = name; + } + + public DataConnectorImpl update() { + return this; + } + + public DataConnector apply() { + this.innerObject = serviceManager.serviceClient() + .getDataConnectors() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DataConnector apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDataConnectors() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + this.innerModel(), context) + .getValue(); + return this; + } + + DataConnectorImpl(DataConnectorInner innerObject, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dataManagerForAgricultureResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); + this.dataConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataConnectors"); + } + + public DataConnector refresh() { + this.innerObject = serviceManager.serviceClient() + .getDataConnectors() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, Context.NONE) + .getValue(); + return this; + } + + public DataConnector refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDataConnectors() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, context) + .getValue(); + return this; + } + + public DataConnectorImpl withProperties(DataConnectorProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorsClientImpl.java new file mode 100644 index 000000000000..44935c4c6219 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorsClientImpl.java @@ -0,0 +1,804 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.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.agrifood.fluent.DataConnectorsClient; +import com.azure.resourcemanager.agrifood.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.agrifood.models.DataConnectorListResponse; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DataConnectorsClient. + */ +public final class DataConnectorsClientImpl implements DataConnectorsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DataConnectorsService service; + + /** + * The service client containing this operation class. + */ + private final AgriFoodManagementClientImpl client; + + /** + * Initializes an instance of DataConnectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataConnectorsClientImpl(AgriFoodManagementClientImpl client) { + this.service + = RestProxy.create(DataConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AgriFoodManagementClientDataConnectors to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AgriFoodManagementCl") + public interface DataConnectorsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/dataConnectors/{dataConnectorName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @PathParam("dataConnectorName") String dataConnectorName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/dataConnectors/{dataConnectorName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @PathParam("dataConnectorName") String dataConnectorName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataConnectorInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/dataConnectors/{dataConnectorName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 400 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @PathParam("dataConnectorName") String dataConnectorName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/dataConnectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$maxPageSize") Integer maxPageSize, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 specific Data Connector resource by DataConnectorName along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String dataConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); + } + if (dataConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, + this.client.getSubscriptionId(), dataManagerForAgricultureResourceName, dataConnectorName, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 specific Data Connector resource by DataConnectorName along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String dataConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); + } + if (dataConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), + dataManagerForAgricultureResourceName, dataConnectorName, this.client.getApiVersion(), accept, context); + } + + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 specific Data Connector resource by DataConnectorName on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 specific Data Connector resource by DataConnectorName along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String dataConnectorName, Context context) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + context).block(); + } + + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 specific Data Connector resource by DataConnectorName. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectorInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName) { + return getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + Context.NONE).getValue(); + } + + /** + * Create or update Data Connector For MADMA resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @param body Body must be valid DataConnector request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataConnector Model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String dataConnectorName, DataConnectorInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); + } + if (dataConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + this.client.getSubscriptionId(), dataManagerForAgricultureResourceName, dataConnectorName, + this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Data Connector For MADMA resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @param body Body must be valid DataConnector request. + * @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 dataConnector Model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String dataConnectorName, DataConnectorInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); + } + if (dataConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), + dataManagerForAgricultureResourceName, dataConnectorName, this.client.getApiVersion(), body, accept, + context); + } + + /** + * Create or update Data Connector For MADMA resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @param body Body must be valid DataConnector request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataConnector Model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String dataConnectorName, DataConnectorInner body) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, + dataConnectorName, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update Data Connector For MADMA resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @param body Body must be valid DataConnector request. + * @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 dataConnector Model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String dataConnectorName, DataConnectorInner body, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, + dataConnectorName, body, context).block(); + } + + /** + * Create or update Data Connector For MADMA resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @param body Body must be valid DataConnector request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dataConnector Model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectorInner createOrUpdate(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName, DataConnectorInner body) { + return createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + body, Context.NONE).getValue(); + } + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @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 dataManagerForAgricultureResourceName, String dataConnectorName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); + } + if (dataConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, + this.client.getSubscriptionId(), dataManagerForAgricultureResourceName, dataConnectorName, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 ManagementException thrown if the request is rejected by server on status code 400. + * @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 dataManagerForAgricultureResourceName, String dataConnectorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); + } + if (dataConnectorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), + dataManagerForAgricultureResourceName, dataConnectorName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @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 dataManagerForAgricultureResourceName, + String dataConnectorName) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 ManagementException thrown if the request is rejected by server on status code 400. + * @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 dataManagerForAgricultureResourceName, + String dataConnectorName, Context context) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + context).block(); + } + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName) { + deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, Context.NONE); + } + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Continuation token for getting next set of results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged response contains list of requested objects and a URL link to get the next set of results along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, Integer maxPageSize, String skipToken) { + 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 (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), maxPageSize, + skipToken, 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 the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Continuation token for getting next set of results. + * @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 paged response contains list of requested objects and a URL link to get the next set of results along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, Integer maxPageSize, String skipToken, 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 (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, this.client.getApiVersion(), maxPageSize, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Continuation token for getting next set of results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged response contains list of requested objects and a URL link to get the next set of results as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, Integer maxPageSize, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, dataManagerForAgricultureResourceName, maxPageSize, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 paged response contains list of requested objects and a URL link to get the next set of results as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + final Integer maxPageSize = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, dataManagerForAgricultureResourceName, maxPageSize, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Continuation token for getting next set of results. + * @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 paged response contains list of requested objects and a URL link to get the next set of results as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, Integer maxPageSize, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, dataManagerForAgricultureResourceName, + maxPageSize, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 paged response contains list of requested objects and a URL link to get the next set of results as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + final Integer maxPageSize = null; + final String skipToken = null; + return new PagedIterable<>( + listAsync(resourceGroupName, dataManagerForAgricultureResourceName, maxPageSize, skipToken)); + } + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Continuation token for getting next set of results. + * @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 paged response contains list of requested objects and a URL link to get the next set of results as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String dataManagerForAgricultureResourceName, Integer maxPageSize, String skipToken, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, dataManagerForAgricultureResourceName, maxPageSize, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged response contains list of requested objects and a URL link to get the next set of results along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 URL to get the next list of items. + * @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 paged response contains list of requested objects and a URL link to get the next set of results along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorsImpl.java new file mode 100644 index 000000000000..e8da2e34f8db --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorsImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.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.agrifood.fluent.DataConnectorsClient; +import com.azure.resourcemanager.agrifood.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.agrifood.models.DataConnector; +import com.azure.resourcemanager.agrifood.models.DataConnectors; + +public final class DataConnectorsImpl implements DataConnectors { + private static final ClientLogger LOGGER = new ClientLogger(DataConnectorsImpl.class); + + private final DataConnectorsClient innerClient; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + public DataConnectorsImpl(DataConnectorsClient innerClient, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String dataConnectorName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataConnectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataConnector get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName) { + DataConnectorInner inner + = this.serviceClient().get(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName); + if (inner != null) { + return new DataConnectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, context); + } + + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName) { + this.serviceClient().delete(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName); + } + + public PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, dataManagerForAgricultureResourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName, + Integer maxPageSize, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, dataManagerForAgricultureResourceName, maxPageSize, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager())); + } + + public DataConnector getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); + } + String dataConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "dataConnectors"); + if (dataConnectorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataConnectors'.", id))); + } + return this + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); + } + String dataConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "dataConnectors"); + if (dataConnectorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataConnectors'.", id))); + } + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); + } + String dataConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "dataConnectors"); + if (dataConnectorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataConnectors'.", id))); + } + this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); + } + String dataConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "dataConnectors"); + if (dataConnectorName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataConnectors'.", id))); + } + return this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, dataConnectorName, + context); + } + + private DataConnectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } + + public DataConnectorImpl define(String name) { + return new DataConnectorImpl(name, this.manager()); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionImpl.java new file mode 100644 index 000000000000..f03c6e8a13dd --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureExtensionInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureExtension; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureExtensionProperties; + +public final class DataManagerForAgricultureExtensionImpl implements DataManagerForAgricultureExtension { + private DataManagerForAgricultureExtensionInner innerObject; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + DataManagerForAgricultureExtensionImpl(DataManagerForAgricultureExtensionInner innerObject, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DataManagerForAgricultureExtensionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DataManagerForAgricultureExtensionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsClientImpl.java similarity index 68% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsClientImpl.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsClientImpl.java index 54c9f50e6656..ad281fc80e73 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsClientImpl.java @@ -25,9 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.agrifood.fluent.FarmBeatsExtensionsClient; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsExtensionListResponse; +import com.azure.resourcemanager.agrifood.fluent.DataManagerForAgricultureExtensionsClient; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureExtensionInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureExtensionListResponse; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -35,13 +35,13 @@ import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in FarmBeatsExtensionsClient. + * An instance of this class provides access to all the operations defined in DataManagerForAgricultureExtensionsClient. */ -public final class FarmBeatsExtensionsClientImpl implements FarmBeatsExtensionsClient { +public final class DataManagerForAgricultureExtensionsClientImpl implements DataManagerForAgricultureExtensionsClient { /** * The proxy service used to perform REST calls. */ - private final FarmBeatsExtensionsService service; + private final DataManagerForAgricultureExtensionsService service; /** * The service client containing this operation class. @@ -49,28 +49,28 @@ public final class FarmBeatsExtensionsClientImpl implements FarmBeatsExtensionsC private final AgriFoodManagementClientImpl client; /** - * Initializes an instance of FarmBeatsExtensionsClientImpl. + * Initializes an instance of DataManagerForAgricultureExtensionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - FarmBeatsExtensionsClientImpl(AgriFoodManagementClientImpl client) { - this.service = RestProxy.create(FarmBeatsExtensionsService.class, client.getHttpPipeline(), + DataManagerForAgricultureExtensionsClientImpl(AgriFoodManagementClientImpl client) { + this.service = RestProxy.create(DataManagerForAgricultureExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AgriFoodManagementClientFarmBeatsExtensions to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AgriFoodManagementClientDataManagerForAgricultureExtensions to be + * used by the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AgriFoodManagementCl") - public interface FarmBeatsExtensionsService { + public interface DataManagerForAgricultureExtensionsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @QueryParam(value = "farmBeatsExtensionIds", multipleQueryParams = true) List farmBeatsExtensionIds, @QueryParam( value = "farmBeatsExtensionNames", @@ -81,27 +81,27 @@ Mono> list(@HostParam("$host") String e @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions/{farmBeatsExtensionId}") + @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions/{dataManagerForAgricultureExtensionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("farmBeatsExtensionId") String farmBeatsExtensionId, + Mono> get(@HostParam("$host") String endpoint, + @PathParam("dataManagerForAgricultureExtensionId") String dataManagerForAgricultureExtensionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. + * @param farmBeatsExtensionIds DataManagerForAgricultureExtension ids. + * @param farmBeatsExtensionNames DataManagerForAgriculture extension names. * @param extensionCategories Extension categories. * @param publisherIds Publisher ids. * @param maxPageSize Maximum number of items needed (inclusive). @@ -109,12 +109,13 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats extension along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Data Manager For Agriculture extension along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(List farmBeatsExtensionIds, - List farmBeatsExtensionNames, List extensionCategories, List publisherIds, - Integer maxPageSize) { + private Mono> listSinglePageAsync( + List farmBeatsExtensionIds, List farmBeatsExtensionNames, List extensionCategories, + List publisherIds, Integer maxPageSize) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -136,16 +137,17 @@ private Mono> listSinglePageAsync(List service.list(this.client.getEndpoint(), farmBeatsExtensionIdsConverted, farmBeatsExtensionNamesConverted, extensionCategoriesConverted, publisherIdsConverted, maxPageSize, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .>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 list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. + * @param farmBeatsExtensionIds DataManagerForAgricultureExtension ids. + * @param farmBeatsExtensionNames DataManagerForAgriculture extension names. * @param extensionCategories Extension categories. * @param publisherIds Publisher ids. * @param maxPageSize Maximum number of items needed (inclusive). @@ -154,12 +156,13 @@ private Mono> listSinglePageAsync(List> listSinglePageAsync(List farmBeatsExtensionIds, - List farmBeatsExtensionNames, List extensionCategories, List publisherIds, - Integer maxPageSize, Context context) { + private Mono> listSinglePageAsync( + List farmBeatsExtensionIds, List farmBeatsExtensionNames, List extensionCategories, + List publisherIds, Integer maxPageSize, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -187,10 +190,10 @@ private Mono> listSinglePageAsync(List> listSinglePageAsync(List listAsync(List farmBeatsExtensionIds, + private PagedFlux listAsync(List farmBeatsExtensionIds, List farmBeatsExtensionNames, List extensionCategories, List publisherIds, Integer maxPageSize) { return new PagedFlux<>(() -> listSinglePageAsync(farmBeatsExtensionIds, farmBeatsExtensionNames, @@ -209,14 +212,14 @@ private PagedFlux listAsync(List farmBeatsExten } /** - * Get list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats extension as paginated response with {@link PagedFlux}. + * @return list of Data Manager For Agriculture extension as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { final List farmBeatsExtensionIds = null; final List farmBeatsExtensionNames = null; final List extensionCategories = null; @@ -227,10 +230,10 @@ private PagedFlux listAsync() { } /** - * Get list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. + * @param farmBeatsExtensionIds DataManagerForAgricultureExtension ids. + * @param farmBeatsExtensionNames DataManagerForAgriculture extension names. * @param extensionCategories Extension categories. * @param publisherIds Publisher ids. * @param maxPageSize Maximum number of items needed (inclusive). @@ -239,10 +242,10 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats extension as paginated response with {@link PagedFlux}. + * @return list of Data Manager For Agriculture extension as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(List farmBeatsExtensionIds, + private PagedFlux listAsync(List farmBeatsExtensionIds, List farmBeatsExtensionNames, List extensionCategories, List publisherIds, Integer maxPageSize, Context context) { return new PagedFlux<>(() -> listSinglePageAsync(farmBeatsExtensionIds, farmBeatsExtensionNames, @@ -251,14 +254,14 @@ private PagedFlux listAsync(List farmBeatsExten } /** - * Get list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats extension as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture extension as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { final List farmBeatsExtensionIds = null; final List farmBeatsExtensionNames = null; final List extensionCategories = null; @@ -269,10 +272,10 @@ public PagedIterable list() { } /** - * Get list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. + * @param farmBeatsExtensionIds DataManagerForAgricultureExtension ids. + * @param farmBeatsExtensionNames DataManagerForAgriculture extension names. * @param extensionCategories Extension categories. * @param publisherIds Publisher ids. * @param maxPageSize Maximum number of items needed (inclusive). @@ -281,10 +284,10 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats extension as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture extension as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(List farmBeatsExtensionIds, + public PagedIterable list(List farmBeatsExtensionIds, List farmBeatsExtensionNames, List extensionCategories, List publisherIds, Integer maxPageSize, Context context) { return new PagedIterable<>(listAsync(farmBeatsExtensionIds, farmBeatsExtensionNames, extensionCategories, @@ -292,98 +295,104 @@ public PagedIterable list(List farmBeatsExtensi } /** - * Get farmBeats extension. + * Get Data Manager For Agriculture extension. * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param dataManagerForAgricultureExtensionId dataManagerForAgricultureExtensionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats extension along with {@link Response} on successful completion of {@link Mono}. + * @return data Manager For Agriculture extension along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String farmBeatsExtensionId) { + private Mono> + getWithResponseAsync(String dataManagerForAgricultureExtensionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (farmBeatsExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsExtensionId is required and cannot be null.")); + if (dataManagerForAgricultureExtensionId == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureExtensionId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), farmBeatsExtensionId, + .withContext(context -> service.get(this.client.getEndpoint(), dataManagerForAgricultureExtensionId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get farmBeats extension. + * Get Data Manager For Agriculture extension. * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param dataManagerForAgricultureExtensionId dataManagerForAgricultureExtensionId to be queried. * @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 farmBeats extension along with {@link Response} on successful completion of {@link Mono}. + * @return data Manager For Agriculture extension along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String farmBeatsExtensionId, Context context) { + private Mono> + getWithResponseAsync(String dataManagerForAgricultureExtensionId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (farmBeatsExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsExtensionId is required and cannot be null.")); + if (dataManagerForAgricultureExtensionId == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureExtensionId is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), farmBeatsExtensionId, this.client.getApiVersion(), accept, - context); + return service.get(this.client.getEndpoint(), dataManagerForAgricultureExtensionId, this.client.getApiVersion(), + accept, context); } /** - * Get farmBeats extension. + * Get Data Manager For Agriculture extension. * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param dataManagerForAgricultureExtensionId dataManagerForAgricultureExtensionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats extension on successful completion of {@link Mono}. + * @return data Manager For Agriculture extension on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String farmBeatsExtensionId) { - return getWithResponseAsync(farmBeatsExtensionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String dataManagerForAgricultureExtensionId) { + return getWithResponseAsync(dataManagerForAgricultureExtensionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get farmBeats extension. + * Get Data Manager For Agriculture extension. * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param dataManagerForAgricultureExtensionId dataManagerForAgricultureExtensionId to be queried. * @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 farmBeats extension along with {@link Response}. + * @return data Manager For Agriculture extension along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String farmBeatsExtensionId, Context context) { - return getWithResponseAsync(farmBeatsExtensionId, context).block(); + public Response + getWithResponse(String dataManagerForAgricultureExtensionId, Context context) { + return getWithResponseAsync(dataManagerForAgricultureExtensionId, context).block(); } /** - * Get farmBeats extension. + * Get Data Manager For Agriculture extension. * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param dataManagerForAgricultureExtensionId dataManagerForAgricultureExtensionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats extension. + * @return data Manager For Agriculture extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsExtensionInner get(String farmBeatsExtensionId) { - return getWithResponse(farmBeatsExtensionId, Context.NONE).getValue(); + public DataManagerForAgricultureExtensionInner get(String dataManagerForAgricultureExtensionId) { + return getWithResponse(dataManagerForAgricultureExtensionId, Context.NONE).getValue(); } /** @@ -397,7 +406,7 @@ public FarmBeatsExtensionInner get(String farmBeatsExtensionId) { * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -407,8 +416,9 @@ private Mono> listNextSinglePageAsync(Str } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .>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())); } @@ -424,7 +434,8 @@ private Mono> listNextSinglePageAsync(Str * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsImpl.java new file mode 100644 index 000000000000..12ba58499918 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.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.agrifood.fluent.DataManagerForAgricultureExtensionsClient; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureExtensionInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureExtension; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureExtensions; +import java.util.List; + +public final class DataManagerForAgricultureExtensionsImpl implements DataManagerForAgricultureExtensions { + private static final ClientLogger LOGGER = new ClientLogger(DataManagerForAgricultureExtensionsImpl.class); + + private final DataManagerForAgricultureExtensionsClient innerClient; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + public DataManagerForAgricultureExtensionsImpl(DataManagerForAgricultureExtensionsClient innerClient, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DataManagerForAgricultureExtensionImpl(inner1, this.manager())); + } + + public PagedIterable list(List farmBeatsExtensionIds, + List farmBeatsExtensionNames, List extensionCategories, List publisherIds, + Integer maxPageSize, Context context) { + PagedIterable inner = this.serviceClient() + .list(farmBeatsExtensionIds, farmBeatsExtensionNames, extensionCategories, publisherIds, maxPageSize, + context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DataManagerForAgricultureExtensionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String dataManagerForAgricultureExtensionId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(dataManagerForAgricultureExtensionId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataManagerForAgricultureExtensionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataManagerForAgricultureExtension get(String dataManagerForAgricultureExtensionId) { + DataManagerForAgricultureExtensionInner inner = this.serviceClient().get(dataManagerForAgricultureExtensionId); + if (inner != null) { + return new DataManagerForAgricultureExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + + private DataManagerForAgricultureExtensionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureImpl.java similarity index 51% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsImpl.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureImpl.java index 4b560a9c5557..650e903cc7c4 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureImpl.java @@ -7,21 +7,24 @@ import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner; import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeats; -import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateProperties; -import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateRequestModel; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgriculture; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureUpdateProperties; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureUpdateRequestModel; import com.azure.resourcemanager.agrifood.models.Identity; import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnection; import com.azure.resourcemanager.agrifood.models.ProvisioningState; import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; import com.azure.resourcemanager.agrifood.models.SensorIntegration; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; -public final class FarmBeatsImpl implements FarmBeats, FarmBeats.Definition, FarmBeats.Update { - private FarmBeatsInner innerObject; +public final class DataManagerForAgricultureImpl + implements DataManagerForAgriculture, DataManagerForAgriculture.Definition, DataManagerForAgriculture.Update { + private DataManagerForAgricultureInner innerObject; private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; @@ -74,12 +77,14 @@ public PublicNetworkAccess publicNetworkAccess() { return this.innerModel().publicNetworkAccess(); } - public PrivateEndpointConnection privateEndpointConnections() { - PrivateEndpointConnectionInner inner = this.innerModel().privateEndpointConnections(); + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { - return null; + return Collections.emptyList(); } } @@ -95,7 +100,7 @@ public String resourceGroupName() { return resourceGroupName; } - public FarmBeatsInner innerModel() { + public DataManagerForAgricultureInner innerModel() { return this.innerObject; } @@ -105,121 +110,125 @@ private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { private String resourceGroupName; - private String farmBeatsResourceName; + private String dataManagerForAgricultureResourceName; - private FarmBeatsUpdateRequestModel updateBody; + private DataManagerForAgricultureUpdateRequestModel updateRequest; - public FarmBeatsImpl withExistingResourceGroup(String resourceGroupName) { + public DataManagerForAgricultureImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; return this; } - public FarmBeats create() { + public DataManagerForAgriculture create() { this.innerObject = serviceManager.serviceClient() - .getFarmBeatsModels() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, this.innerModel(), Context.NONE) + .getDataManagerForAgricultureResources() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, this.innerModel(), + Context.NONE) .getValue(); return this; } - public FarmBeats create(Context context) { + public DataManagerForAgriculture create(Context context) { this.innerObject = serviceManager.serviceClient() - .getFarmBeatsModels() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, this.innerModel(), context) + .getDataManagerForAgricultureResources() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, this.innerModel(), + context) .getValue(); return this; } - FarmBeatsImpl(String name, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { - this.innerObject = new FarmBeatsInner(); + DataManagerForAgricultureImpl(String name, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerObject = new DataManagerForAgricultureInner(); this.serviceManager = serviceManager; - this.farmBeatsResourceName = name; + this.dataManagerForAgricultureResourceName = name; } - public FarmBeatsImpl update() { - this.updateBody = new FarmBeatsUpdateRequestModel(); + public DataManagerForAgricultureImpl update() { + this.updateRequest = new DataManagerForAgricultureUpdateRequestModel(); return this; } - public FarmBeats apply() { + public DataManagerForAgriculture apply() { this.innerObject = serviceManager.serviceClient() - .getFarmBeatsModels() - .update(resourceGroupName, farmBeatsResourceName, updateBody, Context.NONE); + .getDataManagerForAgricultureResources() + .update(resourceGroupName, dataManagerForAgricultureResourceName, updateRequest, Context.NONE); return this; } - public FarmBeats apply(Context context) { + public DataManagerForAgriculture apply(Context context) { this.innerObject = serviceManager.serviceClient() - .getFarmBeatsModels() - .update(resourceGroupName, farmBeatsResourceName, updateBody, context); + .getDataManagerForAgricultureResources() + .update(resourceGroupName, dataManagerForAgricultureResourceName, updateRequest, context); return this; } - FarmBeatsImpl(FarmBeatsInner innerObject, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + DataManagerForAgricultureImpl(DataManagerForAgricultureInner innerObject, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); + this.dataManagerForAgricultureResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); } - public FarmBeats refresh() { + public DataManagerForAgriculture refresh() { this.innerObject = serviceManager.serviceClient() - .getFarmBeatsModels() - .getByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, Context.NONE) + .getDataManagerForAgricultureResources() + .getByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE) .getValue(); return this; } - public FarmBeats refresh(Context context) { + public DataManagerForAgriculture refresh(Context context) { this.innerObject = serviceManager.serviceClient() - .getFarmBeatsModels() - .getByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, context) + .getDataManagerForAgricultureResources() + .getByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, context) .getValue(); return this; } - public FarmBeatsImpl withRegion(Region location) { + public DataManagerForAgricultureImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; } - public FarmBeatsImpl withRegion(String location) { + public DataManagerForAgricultureImpl withRegion(String location) { this.innerModel().withLocation(location); return this; } - public FarmBeatsImpl withTags(Map tags) { + public DataManagerForAgricultureImpl withTags(Map tags) { if (isInCreateMode()) { this.innerModel().withTags(tags); return this; } else { - this.updateBody.withTags(tags); + this.updateRequest.withTags(tags); return this; } } - public FarmBeatsImpl withIdentity(Identity identity) { + public DataManagerForAgricultureImpl withIdentity(Identity identity) { if (isInCreateMode()) { this.innerModel().withIdentity(identity); return this; } else { - this.updateBody.withIdentity(identity); + this.updateRequest.withIdentity(identity); return this; } } - public FarmBeatsImpl withSensorIntegration(SensorIntegration sensorIntegration) { + public DataManagerForAgricultureImpl withSensorIntegration(SensorIntegration sensorIntegration) { this.innerModel().withSensorIntegration(sensorIntegration); return this; } - public FarmBeatsImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + public DataManagerForAgricultureImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { this.innerModel().withPublicNetworkAccess(publicNetworkAccess); return this; } - public FarmBeatsImpl withProperties(FarmBeatsUpdateProperties properties) { - this.updateBody.withProperties(properties); + public DataManagerForAgricultureImpl withProperties(DataManagerForAgricultureUpdateProperties properties) { + this.updateRequest.withProperties(properties); return this; } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesClientImpl.java similarity index 67% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsClientImpl.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesClientImpl.java index a1e87be96f3f..145d5b8b1e95 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesClientImpl.java @@ -32,22 +32,22 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.agrifood.fluent.FarmBeatsModelsClient; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsListResponse; -import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateRequestModel; +import com.azure.resourcemanager.agrifood.fluent.DataManagerForAgricultureResourcesClient; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureListResponse; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureUpdateRequestModel; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in FarmBeatsModelsClient. + * An instance of this class provides access to all the operations defined in DataManagerForAgricultureResourcesClient. */ -public final class FarmBeatsModelsClientImpl implements FarmBeatsModelsClient { +public final class DataManagerForAgricultureResourcesClientImpl implements DataManagerForAgricultureResourcesClient { /** * The proxy service used to perform REST calls. */ - private final FarmBeatsModelsService service; + private final DataManagerForAgricultureResourcesService service; /** * The service client containing this operation class. @@ -55,71 +55,72 @@ public final class FarmBeatsModelsClientImpl implements FarmBeatsModelsClient { private final AgriFoodManagementClientImpl client; /** - * Initializes an instance of FarmBeatsModelsClientImpl. + * Initializes an instance of DataManagerForAgricultureResourcesClientImpl. * * @param client the instance of the service client containing this operation class. */ - FarmBeatsModelsClientImpl(AgriFoodManagementClientImpl client) { - this.service - = RestProxy.create(FarmBeatsModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + DataManagerForAgricultureResourcesClientImpl(AgriFoodManagementClientImpl client) { + this.service = RestProxy.create(DataManagerForAgricultureResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AgriFoodManagementClientFarmBeatsModels to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AgriFoodManagementClientDataManagerForAgricultureResources to be used + * by the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AgriFoodManagementCl") - public interface FarmBeatsModelsService { + public interface DataManagerForAgricultureResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") FarmBeatsInner body, - @HeaderParam("Accept") String accept, Context context); + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataManagerForAgricultureInner request, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FarmBeatsUpdateRequestModel body, @HeaderParam("Accept") String accept, - Context context); + @BodyParam("application/json") DataManagerForAgricultureUpdateRequestModel request, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/farmBeats") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @QueryParam("$maxPageSize") Integer maxPageSize, @QueryParam("$skipToken") String skipToken, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -128,7 +129,7 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, @QueryParam("$maxPageSize") Integer maxPageSize, @QueryParam("$skipToken") String skipToken, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @@ -138,7 +139,7 @@ Mono> listByResourceGroup(@HostParam("$host") St @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -146,24 +147,24 @@ Mono> listBySubscriptionNext( @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeats resource along with {@link Response} on successful completion of {@link Mono}. + * @return dataManagerForAgriculture resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -176,32 +177,32 @@ private Mono> getByResourceGroupWithResponseAsync(Strin return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, dataManagerForAgricultureResourceName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeats resource along with {@link Response} on successful completion of {@link Mono}. + * @return dataManagerForAgriculture resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -214,78 +215,83 @@ private Mono> getByResourceGroupWithResponseAsync(Strin return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, this.client.getApiVersion(), accept, context); + dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context); } /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeats resource on successful completion of {@link Mono}. + * @return dataManagerForAgriculture resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String farmBeatsResourceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, farmBeatsResourceName) + private Mono getByResourceGroupAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeats resource along with {@link Response}. + * @return dataManagerForAgriculture resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String farmBeatsResourceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, farmBeatsResourceName, context).block(); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, context) + .block(); } /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeats resource. + * @return dataManagerForAgriculture resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsInner getByResourceGroup(String resourceGroupName, String farmBeatsResourceName) { - return getByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, Context.NONE).getValue(); + public DataManagerForAgricultureInner getByResourceGroup(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE) + .getValue(); } /** - * Create or update FarmBeats resource. + * Create or update Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body FarmBeats resource create or update request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Data Manager For Agriculture resource create or update request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats ARM Resource along with {@link Response} on successful completion of {@link Mono}. + * @return data Manager For Agriculture ARM Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -298,37 +304,39 @@ private Mono> createOrUpdateWithResponseAsync(String re return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); } else { - body.validate(); + request.validate(); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, this.client.getApiVersion(), body, accept, context)) + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), request, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update FarmBeats resource. + * Create or update Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body FarmBeats resource create or update request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Data Manager For Agriculture resource create or update request object. * @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 farmBeats ARM Resource along with {@link Response} on successful completion of {@link Mono}. + * @return data Manager For Agriculture ARM Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsInner body, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -341,87 +349,91 @@ private Mono> createOrUpdateWithResponseAsync(String re return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); } else { - body.validate(); + request.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, this.client.getApiVersion(), body, accept, context); + dataManagerForAgricultureResourceName, this.client.getApiVersion(), request, accept, context); } /** - * Create or update FarmBeats resource. + * Create or update Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body FarmBeats resource create or update request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Data Manager For Agriculture resource create or update request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats ARM Resource on successful completion of {@link Mono}. + * @return data Manager For Agriculture ARM Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String farmBeatsResourceName, - FarmBeatsInner body) { - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, body) + private Mono createOrUpdateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, request) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create or update FarmBeats resource. + * Create or update Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body FarmBeats resource create or update request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Data Manager For Agriculture resource create or update request object. * @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 farmBeats ARM Resource along with {@link Response}. + * @return data Manager For Agriculture ARM Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String farmBeatsResourceName, - FarmBeatsInner body, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, body, context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, + context).block(); } /** - * Create or update FarmBeats resource. + * Create or update Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body FarmBeats resource create or update request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Data Manager For Agriculture resource create or update request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats ARM Resource. + * @return data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, FarmBeatsInner body) { - return createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, body, Context.NONE).getValue(); + public DataManagerForAgricultureInner createOrUpdate(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request) { + return createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, request, + Context.NONE).getValue(); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats ARM Resource along with {@link Response} on successful completion of {@link Mono}. + * @return data Manager For Agriculture ARM Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsUpdateRequestModel body) { + String dataManagerForAgricultureResourceName, DataManagerForAgricultureUpdateRequestModel request) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -434,37 +446,40 @@ private Mono>> updateWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); } else { - body.validate(); + request.validate(); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, this.client.getApiVersion(), body, accept, context)) + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, this.client.getApiVersion(), request, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @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 farmBeats ARM Resource along with {@link Response} on successful completion of {@link Mono}. + * @return data Manager For Agriculture ARM Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, Context context) { + String dataManagerForAgricultureResourceName, DataManagerForAgricultureUpdateRequestModel request, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -477,181 +492,191 @@ private Mono>> updateWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); } else { - body.validate(); + request.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, this.client.getApiVersion(), body, accept, context); + dataManagerForAgricultureResourceName, this.client.getApiVersion(), request, accept, context); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of farmBeats ARM Resource. + * @return the {@link PollerFlux} for polling of data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, FarmBeatsInner> beginUpdateAsync(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsUpdateRequestModel body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, farmBeatsResourceName, body); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - FarmBeatsInner.class, FarmBeatsInner.class, this.client.getContext()); + private PollerFlux, DataManagerForAgricultureInner> beginUpdateAsync( + String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, request); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DataManagerForAgricultureInner.class, DataManagerForAgricultureInner.class, + this.client.getContext()); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of farmBeats ARM Resource. + * @return the {@link PollerFlux} for polling of data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, FarmBeatsInner> beginUpdateAsync(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, Context context) { + private PollerFlux, DataManagerForAgricultureInner> beginUpdateAsync( + String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request, Context context) { context = this.client.mergeContext(context); Mono>> mono - = updateWithResponseAsync(resourceGroupName, farmBeatsResourceName, body, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - FarmBeatsInner.class, FarmBeatsInner.class, context); + = updateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DataManagerForAgricultureInner.class, DataManagerForAgricultureInner.class, + context); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of farmBeats ARM Resource. + * @return the {@link SyncPoller} for polling of data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, FarmBeatsInner> beginUpdate(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsUpdateRequestModel body) { - return this.beginUpdateAsync(resourceGroupName, farmBeatsResourceName, body).getSyncPoller(); + public SyncPoller, DataManagerForAgricultureInner> beginUpdate( + String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request) { + return this.beginUpdateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request).getSyncPoller(); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of farmBeats ARM Resource. + * @return the {@link SyncPoller} for polling of data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, FarmBeatsInner> beginUpdate(String resourceGroupName, - String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, Context context) { - return this.beginUpdateAsync(resourceGroupName, farmBeatsResourceName, body, context).getSyncPoller(); + public SyncPoller, DataManagerForAgricultureInner> beginUpdate( + String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request, Context context) { + return this.beginUpdateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, context) + .getSyncPoller(); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats ARM Resource on successful completion of {@link Mono}. + * @return data Manager For Agriculture ARM Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String farmBeatsResourceName, - FarmBeatsUpdateRequestModel body) { - return beginUpdateAsync(resourceGroupName, farmBeatsResourceName, body).last() + private Mono updateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureUpdateRequestModel request) { + return beginUpdateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @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 farmBeats ARM Resource on successful completion of {@link Mono}. + * @return data Manager For Agriculture ARM Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String farmBeatsResourceName, - FarmBeatsUpdateRequestModel body, Context context) { - return beginUpdateAsync(resourceGroupName, farmBeatsResourceName, body, context).last() + private Mono updateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureUpdateRequestModel request, + Context context) { + return beginUpdateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats ARM Resource. + * @return data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsInner update(String resourceGroupName, String farmBeatsResourceName, - FarmBeatsUpdateRequestModel body) { - return updateAsync(resourceGroupName, farmBeatsResourceName, body).block(); + public DataManagerForAgricultureInner update(String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request) { + return updateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request).block(); } /** - * Update a FarmBeats resource. + * Update a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body Request object. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param request Request object. * @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 farmBeats ARM Resource. + * @return data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsInner update(String resourceGroupName, String farmBeatsResourceName, - FarmBeatsUpdateRequestModel body, Context context) { - return updateAsync(resourceGroupName, farmBeatsResourceName, body, context).block(); + public DataManagerForAgricultureInner update(String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request, Context context) { + return updateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, context).block(); } /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeatsResourceName) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -664,22 +689,22 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, this.client.getApiVersion(), accept, context)) + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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. @@ -687,8 +712,8 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String farmBeatsResourceName, - Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -701,36 +726,37 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName 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, - farmBeatsResourceName, this.client.getApiVersion(), accept, context); + dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context); } /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeatsResourceName) { - return deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName).flatMap(ignored -> Mono.empty()); + private Mono deleteAsync(String resourceGroupName, String dataManagerForAgricultureResourceName) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName) + .flatMap(ignored -> Mono.empty()); } /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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. @@ -738,26 +764,27 @@ private Mono deleteAsync(String resourceGroupName, String farmBeatsResourc * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName, context).block(); + public Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, context).block(); } /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeatsResourceName) { - deleteWithResponse(resourceGroupName, farmBeatsResourceName, Context.NONE); + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName) { + deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE); } /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -769,7 +796,8 @@ public void delete(String resourceGroupName, String farmBeatsResourceName) { * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer maxPageSize, String skipToken) { + private Mono> listSinglePageAsync(Integer maxPageSize, + String skipToken) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -782,13 +810,13 @@ private Mono> listSinglePageAsync(Integer maxPageS return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), maxPageSize, skipToken, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .>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 the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -801,8 +829,8 @@ private Mono> listSinglePageAsync(Integer maxPageS * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer maxPageSize, String skipToken, - Context context) { + private Mono> listSinglePageAsync(Integer maxPageSize, + String skipToken, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -821,7 +849,7 @@ private Mono> listSinglePageAsync(Integer maxPageS } /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -833,13 +861,13 @@ private Mono> listSinglePageAsync(Integer maxPageS * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer maxPageSize, String skipToken) { + private PagedFlux listAsync(Integer maxPageSize, String skipToken) { return new PagedFlux<>(() -> listSinglePageAsync(maxPageSize, skipToken), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -847,7 +875,7 @@ private PagedFlux listAsync(Integer maxPageSize, String skipToke * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { final Integer maxPageSize = null; final String skipToken = null; return new PagedFlux<>(() -> listSinglePageAsync(maxPageSize, skipToken), @@ -855,7 +883,7 @@ private PagedFlux listAsync() { } /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -868,13 +896,14 @@ private PagedFlux listAsync() { * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer maxPageSize, String skipToken, Context context) { + private PagedFlux listAsync(Integer maxPageSize, String skipToken, + Context context) { return new PagedFlux<>(() -> listSinglePageAsync(maxPageSize, skipToken, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -882,14 +911,14 @@ private PagedFlux listAsync(Integer maxPageSize, String skipToke * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { final Integer maxPageSize = null; final String skipToken = null; return new PagedIterable<>(listAsync(maxPageSize, skipToken)); } /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -902,12 +931,12 @@ public PagedIterable list() { * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Integer maxPageSize, String skipToken, Context context) { + public PagedIterable list(Integer maxPageSize, String skipToken, Context context) { return new PagedIterable<>(listAsync(maxPageSize, skipToken, context)); } /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param maxPageSize Maximum number of items needed (inclusive). @@ -920,8 +949,8 @@ public PagedIterable list(Integer maxPageSize, String skipToken, * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Integer maxPageSize, String skipToken) { + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Integer maxPageSize, String skipToken) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -938,13 +967,13 @@ private Mono> listByResourceGroupSinglePageAsync(S return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), maxPageSize, skipToken, resourceGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .>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 the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param maxPageSize Maximum number of items needed (inclusive). @@ -958,8 +987,8 @@ private Mono> listByResourceGroupSinglePageAsync(S * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Integer maxPageSize, String skipToken, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Integer maxPageSize, String skipToken, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -982,7 +1011,7 @@ private Mono> listByResourceGroupSinglePageAsync(S } /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param maxPageSize Maximum number of items needed (inclusive). @@ -995,14 +1024,14 @@ private Mono> listByResourceGroupSinglePageAsync(S * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer maxPageSize, - String skipToken) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Integer maxPageSize, String skipToken) { return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, maxPageSize, skipToken), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1012,7 +1041,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { final Integer maxPageSize = null; final String skipToken = null; return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, maxPageSize, skipToken), @@ -1020,7 +1049,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN } /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param maxPageSize Maximum number of items needed (inclusive). @@ -1034,15 +1063,15 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer maxPageSize, - String skipToken, Context context) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Integer maxPageSize, String skipToken, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, maxPageSize, skipToken, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1052,14 +1081,14 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { + public PagedIterable listByResourceGroup(String resourceGroupName) { final Integer maxPageSize = null; final String skipToken = null; return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, maxPageSize, skipToken)); } /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param maxPageSize Maximum number of items needed (inclusive). @@ -1073,8 +1102,8 @@ public PagedIterable listByResourceGroup(String resourceGroupNam * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Integer maxPageSize, - String skipToken, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, + Integer maxPageSize, String skipToken, Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, maxPageSize, skipToken, context)); } @@ -1089,7 +1118,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNam * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1101,8 +1130,8 @@ private Mono> listBySubscriptionNextSinglePageAsyn return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .>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())); } @@ -1118,7 +1147,7 @@ private Mono> listBySubscriptionNextSinglePageAsyn * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1145,7 +1174,8 @@ private Mono> listBySubscriptionNextSinglePageAsyn * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1157,8 +1187,8 @@ private Mono> listByResourceGroupNextSinglePageAsy return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .>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())); } @@ -1174,7 +1204,7 @@ private Mono> listByResourceGroupNextSinglePageAsy * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesImpl.java new file mode 100644 index 000000000000..a889446df751 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesImpl.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.agrifood.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.agrifood.fluent.DataManagerForAgricultureResourcesClient; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgriculture; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureResources; + +public final class DataManagerForAgricultureResourcesImpl implements DataManagerForAgricultureResources { + private static final ClientLogger LOGGER = new ClientLogger(DataManagerForAgricultureResourcesImpl.class); + + private final DataManagerForAgricultureResourcesClient innerClient; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + public DataManagerForAgricultureResourcesImpl(DataManagerForAgricultureResourcesClient innerClient, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { + Response inner = this.serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataManagerForAgricultureImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataManagerForAgriculture getByResourceGroup(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + DataManagerForAgricultureInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, dataManagerForAgricultureResourceName); + if (inner != null) { + return new DataManagerForAgricultureImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String dataManagerForAgricultureResourceName) { + this.serviceClient().delete(resourceGroupName, dataManagerForAgricultureResourceName); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataManagerForAgricultureImpl(inner1, this.manager())); + } + + public PagedIterable list(Integer maxPageSize, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(maxPageSize, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataManagerForAgricultureImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataManagerForAgricultureImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Integer maxPageSize, + String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, maxPageSize, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataManagerForAgricultureImpl(inner1, this.manager())); + } + + public DataManagerForAgriculture getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + context); + } + + private DataManagerForAgricultureResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } + + public DataManagerForAgricultureImpl define(String name) { + return new DataManagerForAgricultureImpl(name, this.manager()); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsSolutionImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureSolutionImpl.java similarity index 60% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsSolutionImpl.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureSolutionImpl.java index 06685aed59b3..f6c1ec66c874 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsSolutionImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureSolutionImpl.java @@ -5,16 +5,16 @@ package com.azure.resourcemanager.agrifood.implementation; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsSolutionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsSolution; -import com.azure.resourcemanager.agrifood.models.FarmBeatsSolutionProperties; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureSolutionInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureSolution; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureSolutionProperties; -public final class FarmBeatsSolutionImpl implements FarmBeatsSolution { - private FarmBeatsSolutionInner innerObject; +public final class DataManagerForAgricultureSolutionImpl implements DataManagerForAgricultureSolution { + private DataManagerForAgricultureSolutionInner innerObject; private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - FarmBeatsSolutionImpl(FarmBeatsSolutionInner innerObject, + DataManagerForAgricultureSolutionImpl(DataManagerForAgricultureSolutionInner innerObject, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -32,7 +32,7 @@ public String type() { return this.innerModel().type(); } - public FarmBeatsSolutionProperties properties() { + public DataManagerForAgricultureSolutionProperties properties() { return this.innerModel().properties(); } @@ -40,7 +40,7 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public FarmBeatsSolutionInner innerModel() { + public DataManagerForAgricultureSolutionInner innerModel() { return this.innerObject; } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionImpl.java index d47bb3c82c9a..e274c8446ae7 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionImpl.java @@ -81,7 +81,7 @@ private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { private String resourceGroupName; - private String farmBeatsResourceName; + private String dataManagerForAgricultureResourceName; private String extensionId; @@ -89,17 +89,17 @@ private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { private ExtensionInstallationRequest updateRequestBody; - public ExtensionImpl withExistingFarmBeat(String resourceGroupName, String farmBeatsResourceName) { + public ExtensionImpl withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName) { this.resourceGroupName = resourceGroupName; - this.farmBeatsResourceName = farmBeatsResourceName; + this.dataManagerForAgricultureResourceName = dataManagerForAgricultureResourceName; return this; } public Extension create() { this.innerObject = serviceManager.serviceClient() .getExtensions() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, createRequestBody, - Context.NONE) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + createRequestBody, Context.NONE) .getValue(); return this; } @@ -107,8 +107,8 @@ public Extension create() { public Extension create(Context context) { this.innerObject = serviceManager.serviceClient() .getExtensions() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, createRequestBody, - context) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + createRequestBody, context) .getValue(); return this; } @@ -128,8 +128,8 @@ public ExtensionImpl update() { public Extension apply() { this.innerObject = serviceManager.serviceClient() .getExtensions() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, updateRequestBody, - Context.NONE) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + updateRequestBody, Context.NONE) .getValue(); return this; } @@ -137,8 +137,8 @@ public Extension apply() { public Extension apply(Context context) { this.innerObject = serviceManager.serviceClient() .getExtensions() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, updateRequestBody, - context) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + updateRequestBody, context) .getValue(); return this; } @@ -147,14 +147,15 @@ public Extension apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); + this.dataManagerForAgricultureResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); this.extensionId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "extensions"); } public Extension refresh() { this.innerObject = serviceManager.serviceClient() .getExtensions() - .getWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, Context.NONE) + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, Context.NONE) .getValue(); return this; } @@ -162,7 +163,7 @@ public Extension refresh() { public Extension refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getExtensions() - .getWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, context) + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context) .getValue(); return this; } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionsClientImpl.java index 4d66aa6a8443..0e2783a04a9f 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionsClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionsClientImpl.java @@ -71,47 +71,47 @@ public final class ExtensionsClientImpl implements ExtensionsClient { @ServiceInterface(name = "AgriFoodManagementCl") public interface ExtensionsService { @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}") - @ExpectedResponses({ 200, 201 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/extensions/{extensionId}") + @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("extensionId") String extensionId, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ExtensionInstallationRequest requestBody, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/extensions/{extensionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("extensionId") String extensionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/extensions/{extensionId}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("extensionId") String extensionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/extensions") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/extensions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByFarmBeats(@HostParam("$host") String endpoint, + Mono> listByDataManagerForAgriculture(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @QueryParam("api-version") String apiVersion, @QueryParam(value = "extensionIds", multipleQueryParams = true) List extensionIds, @QueryParam(value = "extensionCategories", multipleQueryParams = true) List extensionCategories, @@ -122,17 +122,17 @@ Mono> listByFarmBeats(@HostParam("$host") String @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByFarmBeatsNext( + Mono> listByDataManagerForAgricultureNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Install or Update extension. AdditionalApiProperties are merged patch and if the extension is updated to a new - * version then the obsolete entries will be auto deleted from AdditionalApiProperties. + * Install or Update extension. Additional Api Properties are merged patch and if the extension is updated to a new + * version then the obsolete entries will be auto deleted from Additional Api Properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param requestBody Extension resource request body. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,7 +142,7 @@ Mono> listByFarmBeatsNext( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String extensionId, ExtensionInstallationRequest requestBody) { + String dataManagerForAgricultureResourceName, String extensionId, ExtensionInstallationRequest requestBody) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -155,9 +155,9 @@ private Mono> createOrUpdateWithResponseAsync(String re return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (extensionId == null) { return Mono.error(new IllegalArgumentException("Parameter extensionId is required and cannot be null.")); @@ -168,17 +168,17 @@ private Mono> createOrUpdateWithResponseAsync(String re final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, extensionId, this.client.getApiVersion(), requestBody, accept, - context)) + resourceGroupName, dataManagerForAgricultureResourceName, extensionId, this.client.getApiVersion(), + requestBody, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Install or Update extension. AdditionalApiProperties are merged patch and if the extension is updated to a new - * version then the obsolete entries will be auto deleted from AdditionalApiProperties. + * Install or Update extension. Additional Api Properties are merged patch and if the extension is updated to a new + * version then the obsolete entries will be auto deleted from Additional Api Properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param requestBody Extension resource request body. * @param context The context to associate with this operation. @@ -189,7 +189,8 @@ private Mono> createOrUpdateWithResponseAsync(String re */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String extensionId, ExtensionInstallationRequest requestBody, Context context) { + String dataManagerForAgricultureResourceName, String extensionId, ExtensionInstallationRequest requestBody, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -202,9 +203,9 @@ private Mono> createOrUpdateWithResponseAsync(String re return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (extensionId == null) { return Mono.error(new IllegalArgumentException("Parameter extensionId is required and cannot be null.")); @@ -215,15 +216,16 @@ private Mono> createOrUpdateWithResponseAsync(String re final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, extensionId, this.client.getApiVersion(), requestBody, accept, context); + dataManagerForAgricultureResourceName, extensionId, this.client.getApiVersion(), requestBody, accept, + context); } /** - * Install or Update extension. AdditionalApiProperties are merged patch and if the extension is updated to a new - * version then the obsolete entries will be auto deleted from AdditionalApiProperties. + * Install or Update extension. Additional Api Properties are merged patch and if the extension is updated to a new + * version then the obsolete entries will be auto deleted from Additional Api Properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -231,19 +233,19 @@ private Mono> createOrUpdateWithResponseAsync(String re * @return extension resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String farmBeatsResourceName, - String extensionId) { + private Mono createOrUpdateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId) { final ExtensionInstallationRequest requestBody = null; - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId, requestBody) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + requestBody).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Install or Update extension. AdditionalApiProperties are merged patch and if the extension is updated to a new - * version then the obsolete entries will be auto deleted from AdditionalApiProperties. + * Install or Update extension. Additional Api Properties are merged patch and if the extension is updated to a new + * version then the obsolete entries will be auto deleted from Additional Api Properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param requestBody Extension resource request body. * @param context The context to associate with this operation. @@ -253,18 +255,19 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * @return extension resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String farmBeatsResourceName, - String extensionId, ExtensionInstallationRequest requestBody, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId, requestBody, - context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId, ExtensionInstallationRequest requestBody, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + requestBody, context).block(); } /** - * Install or Update extension. AdditionalApiProperties are merged patch and if the extension is updated to a new - * version then the obsolete entries will be auto deleted from AdditionalApiProperties. + * Install or Update extension. Additional Api Properties are merged patch and if the extension is updated to a new + * version then the obsolete entries will be auto deleted from Additional Api Properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -272,17 +275,18 @@ public Response createOrUpdateWithResponse(String resourceGroupN * @return extension resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, String extensionId) { + public ExtensionInner createOrUpdate(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId) { final ExtensionInstallationRequest requestBody = null; - return createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, requestBody, - Context.NONE).getValue(); + return createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + requestBody, Context.NONE).getValue(); } /** * Get installed extension details by extension id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -291,8 +295,8 @@ public ExtensionInner createOrUpdate(String resourceGroupName, String farmBeatsR * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String farmBeatsResourceName, - String extensionId) { + private Mono> getWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -305,17 +309,18 @@ private Mono> getWithResponseAsync(String resourceGroup return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (extensionId == null) { return Mono.error(new IllegalArgumentException("Parameter extensionId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, extensionId, this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, extensionId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -323,7 +328,7 @@ private Mono> getWithResponseAsync(String resourceGroup * Get installed extension details by extension id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -333,8 +338,8 @@ private Mono> getWithResponseAsync(String resourceGroup * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String farmBeatsResourceName, - String extensionId, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -347,9 +352,9 @@ private Mono> getWithResponseAsync(String resourceGroup return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (extensionId == null) { return Mono.error(new IllegalArgumentException("Parameter extensionId is required and cannot be null.")); @@ -357,14 +362,14 @@ private Mono> getWithResponseAsync(String resourceGroup final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, extensionId, this.client.getApiVersion(), accept, context); + dataManagerForAgricultureResourceName, extensionId, this.client.getApiVersion(), accept, context); } /** * Get installed extension details by extension id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -372,8 +377,9 @@ private Mono> getWithResponseAsync(String resourceGroup * @return installed extension details by extension id on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId) + private Mono getAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, extensionId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -381,7 +387,7 @@ private Mono getAsync(String resourceGroupName, String farmBeats * Get installed extension details by extension id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -390,16 +396,17 @@ private Mono getAsync(String resourceGroupName, String farmBeats * @return installed extension details by extension id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, - String extensionId, Context context) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId, context).block(); + public Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId, Context context) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context) + .block(); } /** * Get installed extension details by extension id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -407,15 +414,17 @@ public Response getWithResponse(String resourceGroupName, String * @return installed extension details by extension id. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner get(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - return getWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, Context.NONE).getValue(); + public ExtensionInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId) { + return getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, Context.NONE) + .getValue(); } /** * Uninstall extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -423,8 +432,8 @@ public ExtensionInner get(String resourceGroupName, String farmBeatsResourceName * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String farmBeatsResourceName, - String extensionId) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -437,17 +446,18 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (extensionId == null) { return Mono.error(new IllegalArgumentException("Parameter extensionId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, extensionId, this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, extensionId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -455,7 +465,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * Uninstall extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -464,8 +474,8 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String farmBeatsResourceName, - String extensionId, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -478,9 +488,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (extensionId == null) { return Mono.error(new IllegalArgumentException("Parameter extensionId is required and cannot be null.")); @@ -488,14 +498,14 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, extensionId, this.client.getApiVersion(), accept, context); + dataManagerForAgricultureResourceName, extensionId, this.client.getApiVersion(), accept, context); } /** * Uninstall extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -503,8 +513,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - return deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId) + private Mono deleteAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, extensionId) .flatMap(ignored -> Mono.empty()); } @@ -512,7 +523,7 @@ private Mono deleteAsync(String resourceGroupName, String farmBeatsResourc * Uninstall extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -521,31 +532,32 @@ private Mono deleteAsync(String resourceGroupName, String farmBeatsResourc * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, String extensionId, - Context context) { - return deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId, context).block(); + public Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context) + .block(); } /** * Uninstall extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - deleteWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, Context.NONE); + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId) { + deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, Context.NONE); } /** * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionIds Installed extension ids. * @param extensionCategories Installed extension categories. * @param maxPageSize Maximum number of items needed (inclusive). @@ -557,9 +569,9 @@ public void delete(String resourceGroupName, String farmBeatsResourceName, Strin * @return installed extensions details along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByFarmBeatsSinglePageAsync(String resourceGroupName, - String farmBeatsResourceName, List extensionIds, List extensionCategories, Integer maxPageSize, - String skipToken) { + private Mono> listByDataManagerForAgricultureSinglePageAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -572,9 +584,9 @@ private Mono> listByFarmBeatsSinglePageAsync(Strin return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; List extensionIdsConverted = (extensionIds == null) @@ -584,9 +596,10 @@ private Mono> listByFarmBeatsSinglePageAsync(Strin ? new ArrayList<>() : extensionCategories.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); return FluxUtil - .withContext(context -> service.listByFarmBeats(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, this.client.getApiVersion(), extensionIdsConverted, - extensionCategoriesConverted, maxPageSize, skipToken, accept, context)) + .withContext(context -> service.listByDataManagerForAgriculture(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, dataManagerForAgricultureResourceName, + this.client.getApiVersion(), extensionIdsConverted, extensionCategoriesConverted, maxPageSize, + skipToken, 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())); @@ -596,7 +609,7 @@ private Mono> listByFarmBeatsSinglePageAsync(Strin * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionIds Installed extension ids. * @param extensionCategories Installed extension categories. * @param maxPageSize Maximum number of items needed (inclusive). @@ -609,9 +622,9 @@ private Mono> listByFarmBeatsSinglePageAsync(Strin * @return installed extensions details along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByFarmBeatsSinglePageAsync(String resourceGroupName, - String farmBeatsResourceName, List extensionIds, List extensionCategories, Integer maxPageSize, - String skipToken, Context context) { + private Mono> listByDataManagerForAgricultureSinglePageAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -624,9 +637,9 @@ private Mono> listByFarmBeatsSinglePageAsync(Strin return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; List extensionIdsConverted = (extensionIds == null) @@ -637,9 +650,9 @@ private Mono> listByFarmBeatsSinglePageAsync(Strin : extensionCategories.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); context = this.client.mergeContext(context); return service - .listByFarmBeats(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, this.client.getApiVersion(), extensionIdsConverted, extensionCategoriesConverted, - maxPageSize, skipToken, accept, context) + .listByDataManagerForAgriculture(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), + extensionIdsConverted, extensionCategoriesConverted, maxPageSize, skipToken, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -648,7 +661,7 @@ private Mono> listByFarmBeatsSinglePageAsync(Strin * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionIds Installed extension ids. * @param extensionCategories Installed extension categories. * @param maxPageSize Maximum number of items needed (inclusive). @@ -660,39 +673,43 @@ private Mono> listByFarmBeatsSinglePageAsync(Strin * @return installed extensions details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByFarmBeatsAsync(String resourceGroupName, String farmBeatsResourceName, - List extensionIds, List extensionCategories, Integer maxPageSize, String skipToken) { - return new PagedFlux<>(() -> listByFarmBeatsSinglePageAsync(resourceGroupName, farmBeatsResourceName, - extensionIds, extensionCategories, maxPageSize, skipToken), - nextLink -> listByFarmBeatsNextSinglePageAsync(nextLink)); + private PagedFlux listByDataManagerForAgricultureAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken) { + return new PagedFlux<>( + () -> listByDataManagerForAgricultureSinglePageAsync(resourceGroupName, + dataManagerForAgricultureResourceName, extensionIds, extensionCategories, maxPageSize, skipToken), + nextLink -> listByDataManagerForAgricultureNextSinglePageAsync(nextLink)); } /** * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 installed extensions details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByFarmBeatsAsync(String resourceGroupName, String farmBeatsResourceName) { + private PagedFlux listByDataManagerForAgricultureAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName) { final List extensionIds = null; final List extensionCategories = null; final Integer maxPageSize = null; final String skipToken = null; - return new PagedFlux<>(() -> listByFarmBeatsSinglePageAsync(resourceGroupName, farmBeatsResourceName, - extensionIds, extensionCategories, maxPageSize, skipToken), - nextLink -> listByFarmBeatsNextSinglePageAsync(nextLink)); + return new PagedFlux<>( + () -> listByDataManagerForAgricultureSinglePageAsync(resourceGroupName, + dataManagerForAgricultureResourceName, extensionIds, extensionCategories, maxPageSize, skipToken), + nextLink -> listByDataManagerForAgricultureNextSinglePageAsync(nextLink)); } /** * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionIds Installed extension ids. * @param extensionCategories Installed extension categories. * @param maxPageSize Maximum number of items needed (inclusive). @@ -705,40 +722,40 @@ private PagedFlux listByFarmBeatsAsync(String resourceGroupName, * @return installed extensions details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByFarmBeatsAsync(String resourceGroupName, String farmBeatsResourceName, - List extensionIds, List extensionCategories, Integer maxPageSize, String skipToken, - Context context) { - return new PagedFlux<>( - () -> listByFarmBeatsSinglePageAsync(resourceGroupName, farmBeatsResourceName, extensionIds, - extensionCategories, maxPageSize, skipToken, context), - nextLink -> listByFarmBeatsNextSinglePageAsync(nextLink, context)); + private PagedFlux listByDataManagerForAgricultureAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken, Context context) { + return new PagedFlux<>(() -> listByDataManagerForAgricultureSinglePageAsync(resourceGroupName, + dataManagerForAgricultureResourceName, extensionIds, extensionCategories, maxPageSize, skipToken, context), + nextLink -> listByDataManagerForAgricultureNextSinglePageAsync(nextLink, context)); } /** * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 installed extensions details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName) { + public PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName) { final List extensionIds = null; final List extensionCategories = null; final Integer maxPageSize = null; final String skipToken = null; - return new PagedIterable<>(listByFarmBeatsAsync(resourceGroupName, farmBeatsResourceName, extensionIds, - extensionCategories, maxPageSize, skipToken)); + return new PagedIterable<>(listByDataManagerForAgricultureAsync(resourceGroupName, + dataManagerForAgricultureResourceName, extensionIds, extensionCategories, maxPageSize, skipToken)); } /** * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionIds Installed extension ids. * @param extensionCategories Installed extension categories. * @param maxPageSize Maximum number of items needed (inclusive). @@ -751,11 +768,11 @@ public PagedIterable listByFarmBeats(String resourceGroupName, S * @return installed extensions details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName, - List extensionIds, List extensionCategories, Integer maxPageSize, String skipToken, - Context context) { - return new PagedIterable<>(listByFarmBeatsAsync(resourceGroupName, farmBeatsResourceName, extensionIds, - extensionCategories, maxPageSize, skipToken, context)); + public PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken, Context context) { + return new PagedIterable<>(listByDataManagerForAgricultureAsync(resourceGroupName, + dataManagerForAgricultureResourceName, extensionIds, extensionCategories, maxPageSize, skipToken, context)); } /** @@ -769,7 +786,7 @@ public PagedIterable listByFarmBeats(String resourceGroupName, S * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByFarmBeatsNextSinglePageAsync(String nextLink) { + private Mono> listByDataManagerForAgricultureNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -779,7 +796,8 @@ private Mono> listByFarmBeatsNextSinglePageAsync(S } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByFarmBeatsNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listByDataManagerForAgricultureNext(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())); @@ -797,7 +815,8 @@ private Mono> listByFarmBeatsNextSinglePageAsync(S * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByFarmBeatsNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByDataManagerForAgricultureNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -807,7 +826,7 @@ private Mono> listByFarmBeatsNextSinglePageAsync(S } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByFarmBeatsNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByDataManagerForAgricultureNext(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/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionsImpl.java index b0338b18a681..61aed8e25079 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionsImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionsImpl.java @@ -28,10 +28,10 @@ public ExtensionsImpl(ExtensionsClient innerClient, this.serviceManager = serviceManager; } - public Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, + public Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, context); + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ExtensionImpl(inner.getValue(), this.manager())); @@ -40,8 +40,9 @@ public Response getWithResponse(String resourceGroupName, String farm } } - public Extension get(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - ExtensionInner inner = this.serviceClient().get(resourceGroupName, farmBeatsResourceName, extensionId); + public Extension get(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId) { + ExtensionInner inner + = this.serviceClient().get(resourceGroupName, dataManagerForAgricultureResourceName, extensionId); if (inner != null) { return new ExtensionImpl(inner, this.manager()); } else { @@ -49,27 +50,29 @@ public Extension get(String resourceGroupName, String farmBeatsResourceName, Str } } - public Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, String extensionId, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, context); + public Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context); } - public void delete(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - this.serviceClient().delete(resourceGroupName, farmBeatsResourceName, extensionId); + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId) { + this.serviceClient().delete(resourceGroupName, dataManagerForAgricultureResourceName, extensionId); } - public PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName) { - PagedIterable inner - = this.serviceClient().listByFarmBeats(resourceGroupName, farmBeatsResourceName); + public PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + PagedIterable inner = this.serviceClient() + .listByDataManagerForAgriculture(resourceGroupName, dataManagerForAgricultureResourceName); return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); } - public PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName, - List extensionIds, List extensionCategories, Integer maxPageSize, String skipToken, - Context context) { + public PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken, Context context) { PagedIterable inner = this.serviceClient() - .listByFarmBeats(resourceGroupName, farmBeatsResourceName, extensionIds, extensionCategories, maxPageSize, - skipToken, context); + .listByDataManagerForAgriculture(resourceGroupName, dataManagerForAgricultureResourceName, extensionIds, + extensionCategories, maxPageSize, skipToken, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); } @@ -79,8 +82,8 @@ public Extension getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -89,7 +92,8 @@ public Extension getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); } - return this.getWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, Context.NONE) + .getValue(); } public Response getByIdWithResponse(String id, Context context) { @@ -98,8 +102,8 @@ public Response getByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -108,7 +112,7 @@ public Response getByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); } - return this.getWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, context); + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context); } public void deleteById(String id) { @@ -117,8 +121,8 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -127,7 +131,7 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); } - this.deleteWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, Context.NONE); + this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { @@ -136,8 +140,8 @@ public Response deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -146,7 +150,7 @@ public Response deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); } - return this.deleteWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, context); + return this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context); } private ExtensionsClient serviceClient() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionImpl.java deleted file mode 100644 index d350b771da96..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner; -import com.azure.resourcemanager.agrifood.models.DetailedInformation; -import com.azure.resourcemanager.agrifood.models.FarmBeatsExtension; -import java.util.Collections; -import java.util.List; - -public final class FarmBeatsExtensionImpl implements FarmBeatsExtension { - private FarmBeatsExtensionInner innerObject; - - private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - - FarmBeatsExtensionImpl(FarmBeatsExtensionInner innerObject, - com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String targetResourceType() { - return this.innerModel().targetResourceType(); - } - - public String farmBeatsExtensionId() { - return this.innerModel().farmBeatsExtensionId(); - } - - public String farmBeatsExtensionName() { - return this.innerModel().farmBeatsExtensionName(); - } - - public String farmBeatsExtensionVersion() { - return this.innerModel().farmBeatsExtensionVersion(); - } - - public String publisherId() { - return this.innerModel().publisherId(); - } - - public String description() { - return this.innerModel().description(); - } - - public String extensionCategory() { - return this.innerModel().extensionCategory(); - } - - public String extensionAuthLink() { - return this.innerModel().extensionAuthLink(); - } - - public String extensionApiDocsLink() { - return this.innerModel().extensionApiDocsLink(); - } - - public List detailedInformation() { - List inner = this.innerModel().detailedInformation(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public FarmBeatsExtensionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsImpl.java deleted file mode 100644 index b386a6f2fc62..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.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.agrifood.fluent.FarmBeatsExtensionsClient; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsExtension; -import com.azure.resourcemanager.agrifood.models.FarmBeatsExtensions; -import java.util.List; - -public final class FarmBeatsExtensionsImpl implements FarmBeatsExtensions { - private static final ClientLogger LOGGER = new ClientLogger(FarmBeatsExtensionsImpl.class); - - private final FarmBeatsExtensionsClient innerClient; - - private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - - public FarmBeatsExtensionsImpl(FarmBeatsExtensionsClient innerClient, - com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FarmBeatsExtensionImpl(inner1, this.manager())); - } - - public PagedIterable list(List farmBeatsExtensionIds, - List farmBeatsExtensionNames, List extensionCategories, List publisherIds, - Integer maxPageSize, Context context) { - PagedIterable inner = this.serviceClient() - .list(farmBeatsExtensionIds, farmBeatsExtensionNames, extensionCategories, publisherIds, maxPageSize, - context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FarmBeatsExtensionImpl(inner1, this.manager())); - } - - public Response getWithResponse(String farmBeatsExtensionId, Context context) { - Response inner = this.serviceClient().getWithResponse(farmBeatsExtensionId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FarmBeatsExtensionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public FarmBeatsExtension get(String farmBeatsExtensionId) { - FarmBeatsExtensionInner inner = this.serviceClient().get(farmBeatsExtensionId); - if (inner != null) { - return new FarmBeatsExtensionImpl(inner, this.manager()); - } else { - return null; - } - } - - private FarmBeatsExtensionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsImpl.java deleted file mode 100644 index 7792cd44e70a..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.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.agrifood.fluent.FarmBeatsModelsClient; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; -import com.azure.resourcemanager.agrifood.models.FarmBeats; -import com.azure.resourcemanager.agrifood.models.FarmBeatsModels; - -public final class FarmBeatsModelsImpl implements FarmBeatsModels { - private static final ClientLogger LOGGER = new ClientLogger(FarmBeatsModelsImpl.class); - - private final FarmBeatsModelsClient innerClient; - - private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - - public FarmBeatsModelsImpl(FarmBeatsModelsClient innerClient, - com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String farmBeatsResourceName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FarmBeatsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public FarmBeats getByResourceGroup(String resourceGroupName, String farmBeatsResourceName) { - FarmBeatsInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, farmBeatsResourceName); - if (inner != null) { - return new FarmBeatsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String farmBeatsResourceName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, farmBeatsResourceName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String farmBeatsResourceName) { - this.serviceClient().delete(resourceGroupName, farmBeatsResourceName); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FarmBeatsImpl(inner1, this.manager())); - } - - public PagedIterable list(Integer maxPageSize, String skipToken, Context context) { - PagedIterable inner = this.serviceClient().list(maxPageSize, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FarmBeatsImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FarmBeatsImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Integer maxPageSize, String skipToken, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, maxPageSize, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FarmBeatsImpl(inner1, this.manager())); - } - - public FarmBeats getById(String id) { - String resourceGroupName = ResourceManagerUtils.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 farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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 farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.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 farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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 farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, context); - } - - private FarmBeatsModelsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { - return this.serviceManager; - } - - public FarmBeatsImpl define(String name) { - return new FarmBeatsImpl(name, this.manager()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsPropertiesImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsPropertiesImpl.java deleted file mode 100644 index 8d94948b37d4..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsPropertiesImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.implementation; - -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsPropertiesInner; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsProperties; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnection; -import com.azure.resourcemanager.agrifood.models.ProvisioningState; -import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; -import com.azure.resourcemanager.agrifood.models.SensorIntegration; - -public final class FarmBeatsPropertiesImpl implements FarmBeatsProperties { - private FarmBeatsPropertiesInner innerObject; - - private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - - FarmBeatsPropertiesImpl(FarmBeatsPropertiesInner innerObject, - com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String instanceUri() { - return this.innerModel().instanceUri(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public SensorIntegration sensorIntegration() { - return this.innerModel().sensorIntegration(); - } - - public PublicNetworkAccess publicNetworkAccess() { - return this.innerModel().publicNetworkAccess(); - } - - public PrivateEndpointConnection privateEndpointConnections() { - PrivateEndpointConnectionInner inner = this.innerModel().privateEndpointConnections(); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public FarmBeatsPropertiesInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsClientImpl.java index fbd62d916329..a4c572f50d7d 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsClientImpl.java @@ -68,15 +68,15 @@ Mono> get(@HostParam("$host") String endpoint, } /** - * Get operationResults for a FarmBeats resource. + * Get operationResults for a Data Manager For Agriculture resource. * * @param locations Location. - * @param operationResultsId operation Results Id. + * @param operationResultsId operationResultsId for a specific location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operationResults for a FarmBeats resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return operationResults for a Data Manager For Agriculture resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String locations, String operationResultsId) { @@ -103,16 +103,16 @@ private Mono> getWithResponseAsync(String locat } /** - * Get operationResults for a FarmBeats resource. + * Get operationResults for a Data Manager For Agriculture resource. * * @param locations Location. - * @param operationResultsId operation Results Id. + * @param operationResultsId operationResultsId for a specific location. * @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 operationResults for a FarmBeats resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return operationResults for a Data Manager For Agriculture resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String locations, String operationResultsId, @@ -139,14 +139,14 @@ private Mono> getWithResponseAsync(String locat } /** - * Get operationResults for a FarmBeats resource. + * Get operationResults for a Data Manager For Agriculture resource. * * @param locations Location. - * @param operationResultsId operation Results Id. + * @param operationResultsId operationResultsId for a specific location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operationResults for a FarmBeats resource on successful completion of {@link Mono}. + * @return operationResults for a Data Manager For Agriculture resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String locations, String operationResultsId) { @@ -154,15 +154,15 @@ private Mono getAsync(String locations, String operation } /** - * Get operationResults for a FarmBeats resource. + * Get operationResults for a Data Manager For Agriculture resource. * * @param locations Location. - * @param operationResultsId operation Results Id. + * @param operationResultsId operationResultsId for a specific location. * @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 operationResults for a FarmBeats resource along with {@link Response}. + * @return operationResults for a Data Manager For Agriculture resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String locations, String operationResultsId, @@ -171,14 +171,14 @@ public Response getWithResponse(String locations, String } /** - * Get operationResults for a FarmBeats resource. + * Get operationResults for a Data Manager For Agriculture resource. * * @param locations Location. - * @param operationResultsId operation Results Id. + * @param operationResultsId operationResultsId for a specific location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operationResults for a FarmBeats resource. + * @return operationResults for a Data Manager For Agriculture resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public ArmAsyncOperationInner get(String locations, String operationResultsId) { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionImpl.java index f91c4c31b303..df03ec1d4f20 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionImpl.java @@ -71,21 +71,22 @@ private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { private String resourceGroupName; - private String farmBeatsResourceName; + private String dataManagerForAgricultureResourceName; private String privateEndpointConnectionName; - public PrivateEndpointConnectionImpl withExistingFarmBeat(String resourceGroupName, String farmBeatsResourceName) { + public PrivateEndpointConnectionImpl withExistingFarmBeat(String resourceGroupName, + String dataManagerForAgricultureResourceName) { this.resourceGroupName = resourceGroupName; - this.farmBeatsResourceName = farmBeatsResourceName; + this.dataManagerForAgricultureResourceName = dataManagerForAgricultureResourceName; return this; } public PrivateEndpointConnection create() { this.innerObject = serviceManager.serviceClient() .getPrivateEndpointConnections() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, - this.innerModel(), Context.NONE) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -93,8 +94,8 @@ public PrivateEndpointConnection create() { public PrivateEndpointConnection create(Context context) { this.innerObject = serviceManager.serviceClient() .getPrivateEndpointConnections() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, - this.innerModel(), context) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, this.innerModel(), context) .getValue(); return this; } @@ -112,8 +113,8 @@ public PrivateEndpointConnectionImpl update() { public PrivateEndpointConnection apply() { this.innerObject = serviceManager.serviceClient() .getPrivateEndpointConnections() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, - this.innerModel(), Context.NONE) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -121,8 +122,8 @@ public PrivateEndpointConnection apply() { public PrivateEndpointConnection apply(Context context) { this.innerObject = serviceManager.serviceClient() .getPrivateEndpointConnections() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, - this.innerModel(), context) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, this.innerModel(), context) .getValue(); return this; } @@ -132,7 +133,8 @@ public PrivateEndpointConnection apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); + this.dataManagerForAgricultureResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); this.privateEndpointConnectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); } @@ -140,7 +142,8 @@ public PrivateEndpointConnection apply(Context context) { public PrivateEndpointConnection refresh() { this.innerObject = serviceManager.serviceClient() .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, Context.NONE) + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + Context.NONE) .getValue(); return this; } @@ -148,7 +151,8 @@ public PrivateEndpointConnection refresh() { public PrivateEndpointConnection refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context) + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + context) .getValue(); return this; } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionListResultImpl.java new file mode 100644 index 000000000000..a56ba1a3cac5 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.implementation; + +import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnection; +import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnectionListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateEndpointConnectionListResultImpl implements PrivateEndpointConnectionListResult { + private PrivateEndpointConnectionListResultInner innerObject; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + PrivateEndpointConnectionListResultImpl(PrivateEndpointConnectionListResultInner innerObject, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpointConnectionListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionsClientImpl.java index d0cfc3e846f5..69796b9e409d 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionsClientImpl.java @@ -19,10 +19,6 @@ 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; @@ -33,7 +29,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.agrifood.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionListResultInner; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -71,49 +67,50 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi @ServiceInterface(name = "AgriFoodManagementCl") public interface PrivateEndpointConnectionsService { @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 400 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PrivateEndpointConnectionInner body, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner request, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateEndpointConnections") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/privateEndpointConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResource(@HostParam("$host") String endpoint, + Mono> listByResource(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } @@ -121,18 +118,20 @@ Mono> listByResource(@HostParam("$ * Approves or Rejects a Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. - * @param body Request object. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner body) { + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner request) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -145,24 +144,24 @@ private Mono> createOrUpdateWithRespons return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); } else { - body.validate(); + request.validate(); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, this.client.getApiVersion(), - body, accept, context)) + resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + this.client.getApiVersion(), request, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -170,20 +169,21 @@ private Mono> createOrUpdateWithRespons * Approves or Rejects a Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. - * @param body Request object. + * @param request Request object. * @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 ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner body, - Context context) { + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -196,89 +196,95 @@ private Mono> createOrUpdateWithRespons return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); } else { - body.validate(); + request.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, privateEndpointConnectionName, this.client.getApiVersion(), body, accept, context); + dataManagerForAgricultureResourceName, privateEndpointConnectionName, this.client.getApiVersion(), request, + accept, context); } /** * Approves or Rejects a Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. - * @param body Request object. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner body) { - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, - body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner request) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, request).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Approves or Rejects a Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. - * @param body Request object. + * @param request Request object. * @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 ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner body, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, - body, context).block(); + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, request, context).block(); } /** * Approves or Rejects a Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. - * @param body Request object. + * @param request Request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner body) { - return createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, body, - Context.NONE).getValue(); + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner request) { + return createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, request, Context.NONE).getValue(); } /** * Get Private endpoint connection object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -288,7 +294,7 @@ public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName) { + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -301,9 +307,9 @@ private Mono> getWithResponseAsync(Stri return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( @@ -311,9 +317,9 @@ private Mono> getWithResponseAsync(Stri } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -321,7 +327,7 @@ private Mono> getWithResponseAsync(Stri * Get Private endpoint connection object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -332,7 +338,7 @@ private Mono> getWithResponseAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName, Context context) { + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -345,9 +351,9 @@ private Mono> getWithResponseAsync(Stri return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( @@ -356,14 +362,15 @@ private Mono> getWithResponseAsync(Stri final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + dataManagerForAgricultureResourceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, + context); } /** * Get Private endpoint connection object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -372,17 +379,17 @@ private Mono> getWithResponseAsync(Stri * @return private endpoint connection object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get Private endpoint connection object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -393,16 +400,16 @@ private Mono getAsync(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context) - .block(); + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, context).block(); } /** * Get Private endpoint connection object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -411,17 +418,17 @@ public Response getWithResponse(String resourceG * @return private endpoint connection object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get(String resourceGroupName, String farmBeatsResourceName, + public PrivateEndpointConnectionInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { - return getWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, Context.NONE) - .getValue(); + return getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + Context.NONE).getValue(); } /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -430,7 +437,7 @@ public PrivateEndpointConnectionInner get(String resourceGroupName, String farmB */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName) { + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -443,9 +450,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( @@ -453,9 +460,9 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -463,7 +470,7 @@ private Mono>> deleteWithResponseAsync(String resource * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -473,7 +480,7 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String privateEndpointConnectionName, Context context) { + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -486,9 +493,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { return Mono.error(new IllegalArgumentException( @@ -497,14 +504,15 @@ private Mono>> deleteWithResponseAsync(String resource final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + dataManagerForAgricultureResourceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, + context); } /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -512,10 +520,10 @@ private Mono>> deleteWithResponseAsync(String resource * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, + dataManagerForAgricultureResourceName, privateEndpointConnectionName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -524,7 +532,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -533,11 +541,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, + dataManagerForAgricultureResourceName, privateEndpointConnectionName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } @@ -546,7 +554,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -554,9 +562,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName) { - return this.beginDeleteAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { + return this + .beginDeleteAsync(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName) .getSyncPoller(); } @@ -564,7 +573,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -573,9 +582,11 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName, Context context) { - return this.beginDeleteAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + context) .getSyncPoller(); } @@ -583,7 +594,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -591,9 +602,10 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String farmBeatsResourceName, + private Mono deleteAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName).last() + return beginDeleteAsync(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName) + .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -601,7 +613,7 @@ private Mono deleteAsync(String resourceGroupName, String farmBeatsResourc * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -610,32 +622,33 @@ private Mono deleteAsync(String resourceGroupName, String farmBeatsResourc * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String farmBeatsResourceName, + private Mono deleteAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection 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 farmBeatsResourceName, String privateEndpointConnectionName) { - deleteAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName).block(); + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName).block(); } /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -643,25 +656,26 @@ public void delete(String resourceGroupName, String farmBeatsResourceName, Strin * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, - Context context) { - deleteAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context).block(); + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, context) + .block(); } /** * Get list of Private endpoint connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private endpoint connections along with {@link PagedResponse} on successful completion of + * @return list of Private endpoint connections along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync(String resourceGroupName, - String farmBeatsResourceName) { + private Mono> + listByResourceWithResponseAsync(String resourceGroupName, String dataManagerForAgricultureResourceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -674,16 +688,14 @@ private Mono> listByResourceSingle return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -691,17 +703,17 @@ private Mono> listByResourceSingle * Get list of Private endpoint connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private endpoint connections along with {@link PagedResponse} on successful completion of + * @return list of Private endpoint connections along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync(String resourceGroupName, - String farmBeatsResourceName, Context context) { + private Mono> listByResourceWithResponseAsync( + String resourceGroupName, String dataManagerForAgricultureResourceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -714,82 +726,65 @@ private Mono> listByResourceSingle return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + return service.listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context); } /** * Get list of Private endpoint connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private endpoint connections as paginated response with {@link PagedFlux}. + * @return list of Private endpoint connections on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceAsync(String resourceGroupName, - String farmBeatsResourceName) { - return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, farmBeatsResourceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByResourceAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + return listByResourceWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get list of Private endpoint connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private endpoint connections as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceAsync(String resourceGroupName, - String farmBeatsResourceName, Context context) { - return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, farmBeatsResourceName, context)); - } - - /** - * Get list of Private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource 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 list of Private endpoint connections as paginated response with {@link PagedIterable}. + * @return list of Private endpoint connections along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResource(String resourceGroupName, - String farmBeatsResourceName) { - return new PagedIterable<>(listByResourceAsync(resourceGroupName, farmBeatsResourceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByResourceWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { + return listByResourceWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, context) + .block(); } /** * Get list of Private endpoint connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param context The context to associate with this operation. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private endpoint connections as paginated response with {@link PagedIterable}. + * @return list of Private endpoint connections. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResource(String resourceGroupName, - String farmBeatsResourceName, Context context) { - return new PagedIterable<>(listByResourceAsync(resourceGroupName, farmBeatsResourceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionListResultInner listByResource(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + return listByResourceWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE) + .getValue(); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionsImpl.java index 8289020506ee..6d0d8bd7476e 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionsImpl.java @@ -4,14 +4,15 @@ package com.azure.resourcemanager.agrifood.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.agrifood.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionListResultInner; import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnection; +import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnectionListResult; import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnections; public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { @@ -27,10 +28,11 @@ public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClie this.serviceManager = serviceManager; } - public Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName, Context context) { + public Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context) { Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context); + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); @@ -39,10 +41,10 @@ public Response getWithResponse(String resourceGroupN } } - public PrivateEndpointConnection get(String resourceGroupName, String farmBeatsResourceName, + public PrivateEndpointConnection get(String resourceGroupName, String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner - = this.serviceClient().get(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName); + PrivateEndpointConnectionInner inner = this.serviceClient() + .get(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName); if (inner != null) { return new PrivateEndpointConnectionImpl(inner, this.manager()); } else { @@ -50,27 +52,39 @@ public PrivateEndpointConnection get(String resourceGroupName, String farmBeatsR } } - public void delete(String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName) { - this.serviceClient().delete(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName); + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName) { + this.serviceClient() + .delete(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName); } - public void delete(String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, - Context context) { - this.serviceClient().delete(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context); + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName, Context context) { + this.serviceClient() + .delete(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, context); } - public PagedIterable listByResource(String resourceGroupName, - String farmBeatsResourceName) { - PagedIterable inner - = this.serviceClient().listByResource(resourceGroupName, farmBeatsResourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + public Response listByResourceWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { + Response inner = this.serviceClient() + .listByResourceWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable listByResource(String resourceGroupName, - String farmBeatsResourceName, Context context) { - PagedIterable inner - = this.serviceClient().listByResource(resourceGroupName, farmBeatsResourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + public PrivateEndpointConnectionListResult listByResource(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + PrivateEndpointConnectionListResultInner inner + = this.serviceClient().listByResource(resourceGroupName, dataManagerForAgricultureResourceName); + if (inner != null) { + return new PrivateEndpointConnectionListResultImpl(inner, this.manager()); + } else { + return null; + } } public PrivateEndpointConnection getById(String id) { @@ -79,8 +93,8 @@ public PrivateEndpointConnection getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -91,7 +105,8 @@ public PrivateEndpointConnection getById(String id) { .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } return this - .getWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, Context.NONE) + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + Context.NONE) .getValue(); } @@ -101,8 +116,8 @@ public Response getByIdWithResponse(String id, Contex throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -112,7 +127,8 @@ public Response getByIdWithResponse(String id, Contex throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } - return this.getWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context); + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, context); } public void deleteById(String id) { @@ -121,8 +137,8 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -132,7 +148,8 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } - this.delete(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, Context.NONE); + this.delete(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { @@ -141,8 +158,8 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -152,7 +169,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } - this.delete(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context); + this.delete(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, context); } private PrivateEndpointConnectionsClient serviceClient() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourceListResultImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 000000000000..c977552b9a4a --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.implementation; + +import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.agrifood.models.PrivateLinkResource; +import com.azure.resourcemanager.agrifood.models.PrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + PrivateLinkResourceListResultImpl(PrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourcesClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourcesClientImpl.java index 42e8bf852b2b..ea11a1f5074b 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourcesClientImpl.java @@ -16,10 +16,6 @@ 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; @@ -27,7 +23,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.agrifood.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.agrifood.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceListResultInner; import reactor.core.publisher.Mono; /** @@ -63,24 +59,24 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource @ServiceInterface(name = "AgriFoodManagementCl") public interface PrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateLinkResources") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResource(@HostParam("$host") String endpoint, + Mono> listByResource(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/privateLinkResources/{subResourceName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/privateLinkResources/{subResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("subResourceName") String subResourceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } @@ -89,15 +85,15 @@ Mono> get(@HostParam("$host") String endpoint * Get list of Private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private link resources along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Private link resources along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync(String resourceGroupName, - String farmBeatsResourceName) { + private Mono> listByResourceWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -110,16 +106,14 @@ private Mono> listByResourceSinglePageAs return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -127,16 +121,16 @@ private Mono> listByResourceSinglePageAs * Get list of Private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private link resources along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Private link resources along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync(String resourceGroupName, - String farmBeatsResourceName, Context context) { + private Mono> listByResourceWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -149,90 +143,73 @@ private Mono> listByResourceSinglePageAs return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + return service.listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context); } /** * Get list of Private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private link resources as paginated response with {@link PagedFlux}. + * @return list of Private link resources on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceAsync(String resourceGroupName, - String farmBeatsResourceName) { - return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, farmBeatsResourceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByResourceAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + return listByResourceWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get list of Private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private link resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceAsync(String resourceGroupName, - String farmBeatsResourceName, Context context) { - return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, farmBeatsResourceName, context)); - } - - /** - * Get list of Private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource 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 list of Private link resources as paginated response with {@link PagedIterable}. + * @return list of Private link resources along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResource(String resourceGroupName, - String farmBeatsResourceName) { - return new PagedIterable<>(listByResourceAsync(resourceGroupName, farmBeatsResourceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByResourceWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { + return listByResourceWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, context) + .block(); } /** * Get list of Private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param context The context to associate with this operation. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private link resources as paginated response with {@link PagedIterable}. + * @return list of Private link resources. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResource(String resourceGroupName, - String farmBeatsResourceName, Context context) { - return new PagedIterable<>(listByResourceAsync(resourceGroupName, farmBeatsResourceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner listByResource(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + return listByResourceWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE) + .getValue(); } /** * Get Private link resource object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param subResourceName Sub resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -242,7 +219,7 @@ public PagedIterable listByResource(String resourceGro */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String subResourceName) { + String dataManagerForAgricultureResourceName, String subResourceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -255,9 +232,9 @@ private Mono> getWithResponseAsync(String res return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (subResourceName == null) { return Mono @@ -265,9 +242,9 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, subResourceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, subResourceName, this.client.getApiVersion(), + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -275,7 +252,7 @@ private Mono> getWithResponseAsync(String res * Get Private link resource object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param subResourceName Sub resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -286,7 +263,7 @@ private Mono> getWithResponseAsync(String res */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String subResourceName, Context context) { + String dataManagerForAgricultureResourceName, String subResourceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -299,9 +276,9 @@ private Mono> getWithResponseAsync(String res return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (subResourceName == null) { return Mono @@ -310,14 +287,14 @@ private Mono> getWithResponseAsync(String res final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, subResourceName, this.client.getApiVersion(), accept, context); + dataManagerForAgricultureResourceName, subResourceName, this.client.getApiVersion(), accept, context); } /** * Get Private link resource object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param subResourceName Sub resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -326,9 +303,9 @@ private Mono> getWithResponseAsync(String res * @return private link resource object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String farmBeatsResourceName, - String subResourceName) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, subResourceName) + private Mono getAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String subResourceName) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, subResourceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -336,7 +313,7 @@ private Mono getAsync(String resourceGroupName, String * Get Private link resource object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param subResourceName Sub resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -346,16 +323,17 @@ private Mono getAsync(String resourceGroupName, String * @return private link resource object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, - String subResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, subResourceName, context).block(); + public Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String subResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, subResourceName, context) + .block(); } /** * Get Private link resource object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param subResourceName Sub resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -364,8 +342,9 @@ public Response getWithResponse(String resourceGroupNa * @return private link resource object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner get(String resourceGroupName, String farmBeatsResourceName, + public PrivateLinkResourceInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, String subResourceName) { - return getWithResponse(resourceGroupName, farmBeatsResourceName, subResourceName, Context.NONE).getValue(); + return getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, subResourceName, Context.NONE) + .getValue(); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourcesImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourcesImpl.java index c9826acc7f5a..f725c1b52474 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourcesImpl.java @@ -4,14 +4,15 @@ package com.azure.resourcemanager.agrifood.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.agrifood.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceListResultInner; import com.azure.resourcemanager.agrifood.models.PrivateLinkResource; +import com.azure.resourcemanager.agrifood.models.PrivateLinkResourceListResult; import com.azure.resourcemanager.agrifood.models.PrivateLinkResources; public final class PrivateLinkResourcesImpl implements PrivateLinkResources { @@ -27,23 +28,33 @@ public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName) { - PagedIterable inner - = this.serviceClient().listByResource(resourceGroupName, farmBeatsResourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + public Response listByResourceWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { + Response inner = this.serviceClient() + .listByResourceWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName, - Context context) { - PagedIterable inner - = this.serviceClient().listByResource(resourceGroupName, farmBeatsResourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + public PrivateLinkResourceListResult listByResource(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + PrivateLinkResourceListResultInner inner + = this.serviceClient().listByResource(resourceGroupName, dataManagerForAgricultureResourceName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } } - public Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, - String subResourceName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, farmBeatsResourceName, subResourceName, context); + public Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String subResourceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, subResourceName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateLinkResourceImpl(inner.getValue(), this.manager())); @@ -52,9 +63,10 @@ public Response getWithResponse(String resourceGroupName, S } } - public PrivateLinkResource get(String resourceGroupName, String farmBeatsResourceName, String subResourceName) { + public PrivateLinkResource get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String subResourceName) { PrivateLinkResourceInner inner - = this.serviceClient().get(resourceGroupName, farmBeatsResourceName, subResourceName); + = this.serviceClient().get(resourceGroupName, dataManagerForAgricultureResourceName, subResourceName); if (inner != null) { return new PrivateLinkResourceImpl(inner, this.manager()); } else { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionImpl.java index 1859d7d105da..fd229c6566ff 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionImpl.java @@ -8,7 +8,6 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.agrifood.fluent.models.SolutionInner; import com.azure.resourcemanager.agrifood.models.Solution; -import com.azure.resourcemanager.agrifood.models.SolutionInstallationRequest; import com.azure.resourcemanager.agrifood.models.SolutionProperties; public final class SolutionImpl implements Solution, Solution.Definition, Solution.Update { @@ -54,24 +53,21 @@ private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { private String resourceGroupName; - private String farmBeatsResourceName; + private String dataManagerForAgricultureResourceName; private String solutionId; - private SolutionInstallationRequest createBody; - - private SolutionInstallationRequest updateBody; - - public SolutionImpl withExistingFarmBeat(String resourceGroupName, String farmBeatsResourceName) { + public SolutionImpl withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName) { this.resourceGroupName = resourceGroupName; - this.farmBeatsResourceName = farmBeatsResourceName; + this.dataManagerForAgricultureResourceName = dataManagerForAgricultureResourceName; return this; } public Solution create() { this.innerObject = serviceManager.serviceClient() .getSolutions() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, createBody, Context.NONE) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + this.innerModel(), Context.NONE) .getValue(); return this; } @@ -79,7 +75,8 @@ public Solution create() { public Solution create(Context context) { this.innerObject = serviceManager.serviceClient() .getSolutions() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, createBody, context) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + this.innerModel(), context) .getValue(); return this; } @@ -88,18 +85,17 @@ public Solution create(Context context) { this.innerObject = new SolutionInner(); this.serviceManager = serviceManager; this.solutionId = name; - this.createBody = new SolutionInstallationRequest(); } public SolutionImpl update() { - this.updateBody = new SolutionInstallationRequest(); return this; } public Solution apply() { this.innerObject = serviceManager.serviceClient() .getSolutions() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, updateBody, Context.NONE) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + this.innerModel(), Context.NONE) .getValue(); return this; } @@ -107,7 +103,8 @@ public Solution apply() { public Solution apply(Context context) { this.innerObject = serviceManager.serviceClient() .getSolutions() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, updateBody, context) + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + this.innerModel(), context) .getValue(); return this; } @@ -116,14 +113,15 @@ public Solution apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); + this.dataManagerForAgricultureResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); this.solutionId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "solutions"); } public Solution refresh() { this.innerObject = serviceManager.serviceClient() .getSolutions() - .getWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, Context.NONE) + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, Context.NONE) .getValue(); return this; } @@ -131,22 +129,13 @@ public Solution refresh() { public Solution refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getSolutions() - .getWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, context) + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, context) .getValue(); return this; } public SolutionImpl withProperties(SolutionProperties properties) { - if (isInCreateMode()) { - this.createBody.withProperties(properties); - return this; - } else { - this.updateBody.withProperties(properties); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; + this.innerModel().withProperties(properties); + return this; } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsClientImpl.java index 1f28f8cb7c7e..b2c224d50843 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsClientImpl.java @@ -30,7 +30,6 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.agrifood.fluent.SolutionsClient; import com.azure.resourcemanager.agrifood.fluent.models.SolutionInner; -import com.azure.resourcemanager.agrifood.models.SolutionInstallationRequest; import com.azure.resourcemanager.agrifood.models.SolutionListResponse; import java.time.OffsetDateTime; import java.util.ArrayList; @@ -72,47 +71,48 @@ public final class SolutionsClientImpl implements SolutionsClient { @ServiceInterface(name = "AgriFoodManagementCl") public interface SolutionsService { @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/solutions/{solutionId}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/solutions/{solutionId}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("solutionId") String solutionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SolutionInstallationRequest body, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SolutionInner requestBody, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/solutions/{solutionId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/solutions/{solutionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("solutionId") String solutionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/solutions/{solutionId}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/solutions/{solutionId}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, @PathParam("solutionId") String solutionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName}/solutions") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/solutions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @QueryParam("api-version") String apiVersion, @QueryParam(value = "solutionIds", multipleQueryParams = true) List solutionIds, @QueryParam(value = "ids", multipleQueryParams = true) List ids, @QueryParam(value = "names", multipleQueryParams = true) List names, @@ -123,7 +123,7 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("minLastModifiedDateTime") OffsetDateTime minLastModifiedDateTime, @QueryParam("maxLastModifiedDateTime") OffsetDateTime maxLastModifiedDateTime, @QueryParam("$maxPageSize") Integer maxPageSize, @QueryParam("$skipToken") String skipToken, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -137,9 +137,9 @@ Mono> listNext(@PathParam(value = "nextLink", enc * Install Or Update Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. - * @param body Solution resource request body. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. + * @param requestBody Solution resource request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -147,7 +147,7 @@ Mono> listNext(@PathParam(value = "nextLink", enc */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String solutionId, SolutionInstallationRequest body) { + String dataManagerForAgricultureResourceName, String solutionId, SolutionInner requestBody) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -160,21 +160,21 @@ private Mono> createOrUpdateWithResponseAsync(String res return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (solutionId == null) { return Mono.error(new IllegalArgumentException("Parameter solutionId is required and cannot be null.")); } - if (body != null) { - body.validate(); + if (requestBody != null) { + requestBody.validate(); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, solutionId, this.client.getApiVersion(), body, accept, - context)) + resourceGroupName, dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), + requestBody, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -182,9 +182,9 @@ private Mono> createOrUpdateWithResponseAsync(String res * Install Or Update Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. - * @param body Solution resource request body. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. + * @param requestBody Solution resource request body. * @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. @@ -193,7 +193,7 @@ private Mono> createOrUpdateWithResponseAsync(String res */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String farmBeatsResourceName, String solutionId, SolutionInstallationRequest body, Context context) { + String dataManagerForAgricultureResourceName, String solutionId, SolutionInner requestBody, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -206,48 +206,49 @@ private Mono> createOrUpdateWithResponseAsync(String res return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (solutionId == null) { return Mono.error(new IllegalArgumentException("Parameter solutionId is required and cannot be null.")); } - if (body != null) { - body.validate(); + if (requestBody != null) { + requestBody.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, solutionId, this.client.getApiVersion(), body, accept, context); + dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), requestBody, accept, + context); } /** * Install Or Update Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return solution resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String farmBeatsResourceName, - String solutionId) { - final SolutionInstallationRequest body = null; - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, solutionId, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String solutionId) { + final SolutionInner requestBody = null; + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + requestBody).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Install Or Update Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. - * @param body Solution resource request body. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. + * @param requestBody Solution resource request body. * @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. @@ -255,36 +256,37 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * @return solution resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String farmBeatsResourceName, - String solutionId, SolutionInstallationRequest body, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, solutionId, body, context) - .block(); + public Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String solutionId, SolutionInner requestBody, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + requestBody, context).block(); } /** * Install Or Update Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return solution resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SolutionInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, String solutionId) { - final SolutionInstallationRequest body = null; - return createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, body, Context.NONE) - .getValue(); + public SolutionInner createOrUpdate(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId) { + final SolutionInner requestBody = null; + return createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + requestBody, Context.NONE).getValue(); } /** * Get installed Solution details by Solution id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -292,8 +294,8 @@ public SolutionInner createOrUpdate(String resourceGroupName, String farmBeatsRe * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String farmBeatsResourceName, - String solutionId) { + private Mono> getWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String solutionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -306,17 +308,18 @@ private Mono> getWithResponseAsync(String resourceGroupN return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (solutionId == null) { return Mono.error(new IllegalArgumentException("Parameter solutionId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, solutionId, this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -324,8 +327,8 @@ private Mono> getWithResponseAsync(String resourceGroupN * Get installed Solution details by Solution id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -334,8 +337,8 @@ private Mono> getWithResponseAsync(String resourceGroupN * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String farmBeatsResourceName, - String solutionId, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String solutionId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -348,9 +351,9 @@ private Mono> getWithResponseAsync(String resourceGroupN return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (solutionId == null) { return Mono.error(new IllegalArgumentException("Parameter solutionId is required and cannot be null.")); @@ -358,23 +361,24 @@ private Mono> getWithResponseAsync(String resourceGroupN final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, solutionId, this.client.getApiVersion(), accept, context); + dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), accept, context); } /** * Get installed Solution details by Solution id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return installed Solution details by Solution id on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String farmBeatsResourceName, String solutionId) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, solutionId) + private Mono getAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -382,8 +386,8 @@ private Mono getAsync(String resourceGroupName, String farmBeatsR * Get installed Solution details by Solution id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -391,41 +395,44 @@ private Mono getAsync(String resourceGroupName, String farmBeatsR * @return installed Solution details by Solution id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, - String solutionId, Context context) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, solutionId, context).block(); + public Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String solutionId, Context context) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, context) + .block(); } /** * Get installed Solution details by Solution id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return installed Solution details by Solution id. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SolutionInner get(String resourceGroupName, String farmBeatsResourceName, String solutionId) { - return getWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, Context.NONE).getValue(); + public SolutionInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId) { + return getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, Context.NONE) + .getValue(); } /** * Uninstall Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String farmBeatsResourceName, - String solutionId) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String solutionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -438,17 +445,18 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (solutionId == null) { return Mono.error(new IllegalArgumentException("Parameter solutionId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, farmBeatsResourceName, solutionId, this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -456,8 +464,8 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * Uninstall Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -465,8 +473,8 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String farmBeatsResourceName, - String solutionId, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String solutionId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -479,9 +487,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } if (solutionId == null) { return Mono.error(new IllegalArgumentException("Parameter solutionId is required and cannot be null.")); @@ -489,23 +497,24 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, solutionId, this.client.getApiVersion(), accept, context); + dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), accept, context); } /** * Uninstall Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String farmBeatsResourceName, String solutionId) { - return deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName, solutionId) + private Mono deleteAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionId) .flatMap(ignored -> Mono.empty()); } @@ -513,8 +522,8 @@ private Mono deleteAsync(String resourceGroupName, String farmBeatsResourc * Uninstall Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -522,31 +531,32 @@ private Mono deleteAsync(String resourceGroupName, String farmBeatsResourc * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, String solutionId, - Context context) { - return deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName, solutionId, context).block(); + public Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId, Context context) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, context) + .block(); } /** * Uninstall Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String farmBeatsResourceName, String solutionId) { - deleteWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, Context.NONE); + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String solutionId) { + deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, Context.NONE); } /** * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param solutionIds Installed Solution ids. * @param ids Ids of the resource. * @param names Names of the resource. @@ -567,7 +577,7 @@ public void delete(String resourceGroupName, String farmBeatsResourceName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, - String farmBeatsResourceName, List solutionIds, List ids, List names, + String dataManagerForAgricultureResourceName, List solutionIds, List ids, List names, List propertyFilters, List statuses, OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, OffsetDateTime minLastModifiedDateTime, OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, String skipToken) { @@ -583,9 +593,9 @@ private Mono> listSinglePageAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; List solutionIdsConverted = (solutionIds == null) @@ -604,11 +614,11 @@ private Mono> listSinglePageAsync(String resourceGr ? new ArrayList<>() : statuses.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - farmBeatsResourceName, solutionIdsConverted, idsConverted, namesConverted, propertyFiltersConverted, - statusesConverted, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, - maxLastModifiedDateTime, maxPageSize, skipToken, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), + solutionIdsConverted, idsConverted, namesConverted, propertyFiltersConverted, statusesConverted, + minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, + skipToken, 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())); @@ -618,7 +628,7 @@ private Mono> listSinglePageAsync(String resourceGr * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param solutionIds Installed Solution ids. * @param ids Ids of the resource. * @param names Names of the resource. @@ -640,7 +650,7 @@ private Mono> listSinglePageAsync(String resourceGr */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, - String farmBeatsResourceName, List solutionIds, List ids, List names, + String dataManagerForAgricultureResourceName, List solutionIds, List ids, List names, List propertyFilters, List statuses, OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, OffsetDateTime minLastModifiedDateTime, OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, String skipToken, Context context) { @@ -656,9 +666,9 @@ private Mono> listSinglePageAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); + if (dataManagerForAgricultureResourceName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureResourceName is required and cannot be null.")); } final String accept = "application/json"; List solutionIdsConverted = (solutionIds == null) @@ -678,10 +688,10 @@ private Mono> listSinglePageAsync(String resourceGr : statuses.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, farmBeatsResourceName, - solutionIdsConverted, idsConverted, namesConverted, propertyFiltersConverted, statusesConverted, - minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, - skipToken, this.client.getApiVersion(), accept, context) + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, this.client.getApiVersion(), solutionIdsConverted, idsConverted, + namesConverted, propertyFiltersConverted, statusesConverted, minCreatedDateTime, maxCreatedDateTime, + minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -690,7 +700,7 @@ private Mono> listSinglePageAsync(String resourceGr * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param solutionIds Installed Solution ids. * @param ids Ids of the resource. * @param names Names of the resource. @@ -710,28 +720,29 @@ private Mono> listSinglePageAsync(String resourceGr * @return installed Solutions details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String farmBeatsResourceName, + private PagedFlux listAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, List solutionIds, List ids, List names, List propertyFilters, List statuses, OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, OffsetDateTime minLastModifiedDateTime, OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, farmBeatsResourceName, solutionIds, ids, - names, propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, - maxLastModifiedDateTime, maxPageSize, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, dataManagerForAgricultureResourceName, + solutionIds, ids, names, propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, + minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 installed Solutions details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String farmBeatsResourceName) { + private PagedFlux listAsync(String resourceGroupName, String dataManagerForAgricultureResourceName) { final List solutionIds = null; final List ids = null; final List names = null; @@ -743,16 +754,17 @@ private PagedFlux listAsync(String resourceGroupName, String farm final OffsetDateTime maxLastModifiedDateTime = null; final Integer maxPageSize = null; final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, farmBeatsResourceName, solutionIds, ids, - names, propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, - maxLastModifiedDateTime, maxPageSize, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, dataManagerForAgricultureResourceName, + solutionIds, ids, names, propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, + minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param solutionIds Installed Solution ids. * @param ids Ids of the resource. * @param names Names of the resource. @@ -773,13 +785,13 @@ private PagedFlux listAsync(String resourceGroupName, String farm * @return installed Solutions details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String farmBeatsResourceName, + private PagedFlux listAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, List solutionIds, List ids, List names, List propertyFilters, List statuses, OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, OffsetDateTime minLastModifiedDateTime, OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, String skipToken, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, farmBeatsResourceName, solutionIds, ids, names, + () -> listSinglePageAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionIds, ids, names, propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -789,14 +801,14 @@ private PagedFlux listAsync(String resourceGroupName, String farm * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 installed Solutions details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String farmBeatsResourceName) { + public PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName) { final List solutionIds = null; final List ids = null; final List names = null; @@ -808,8 +820,8 @@ public PagedIterable list(String resourceGroupName, String farmBe final OffsetDateTime maxLastModifiedDateTime = null; final Integer maxPageSize = null; final String skipToken = null; - return new PagedIterable<>(listAsync(resourceGroupName, farmBeatsResourceName, solutionIds, ids, names, - propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, + return new PagedIterable<>(listAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionIds, ids, + names, propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken)); } @@ -817,7 +829,7 @@ public PagedIterable list(String resourceGroupName, String farmBe * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param solutionIds Installed Solution ids. * @param ids Ids of the resource. * @param names Names of the resource. @@ -838,13 +850,13 @@ public PagedIterable list(String resourceGroupName, String farmBe * @return installed Solutions details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String farmBeatsResourceName, + public PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName, List solutionIds, List ids, List names, List propertyFilters, List statuses, OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, OffsetDateTime minLastModifiedDateTime, OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, String skipToken, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, farmBeatsResourceName, solutionIds, ids, names, - propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, + return new PagedIterable<>(listAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionIds, ids, + names, propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context)); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesClientImpl.java index f941a2400d94..38625df82745 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesClientImpl.java @@ -26,8 +26,8 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.agrifood.fluent.SolutionsDiscoverabilitiesClient; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsSolutionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsSolutionListResponse; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureSolutionInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureSolutionListResponse; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -70,7 +70,7 @@ public interface SolutionsDiscoverabilitiesService { @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsSolutionDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @QueryParam(value = "farmBeatsSolutionIds", multipleQueryParams = true) List farmBeatsSolutionIds, @QueryParam( value = "farmBeatsSolutionNames", @@ -79,37 +79,39 @@ Mono> list(@HostParam("$host") String en @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsSolutionDefinitions/{farmBeatsSolutionId}") + @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsSolutionDefinitions/{dataManagerForAgricultureSolutionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("farmBeatsSolutionId") String farmBeatsSolutionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("$host") String endpoint, + @PathParam("dataManagerForAgricultureSolutionId") String dataManagerForAgricultureSolutionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * - * @param farmBeatsSolutionIds Ids of FarmBeats Solutions which the customer requests to fetch. - * @param farmBeatsSolutionNames Names of FarmBeats Solutions which the customer requests to fetch. + * @param farmBeatsSolutionIds Ids of Data Manager For Agriculture Solutions which the customer requests to fetch. + * @param farmBeatsSolutionNames Names of Data Manager For Agriculture Solutions which the customer requests to + * fetch. * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Data Manager For Agriculture solutions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(List farmBeatsSolutionIds, - List farmBeatsSolutionNames, Integer maxPageSize) { + private Mono> listSinglePageAsync( + List farmBeatsSolutionIds, List farmBeatsSolutionNames, Integer maxPageSize) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -124,27 +126,29 @@ private Mono> listSinglePageAsync(List service.list(this.client.getEndpoint(), farmBeatsSolutionIdsConverted, farmBeatsSolutionNamesConverted, maxPageSize, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + .>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 list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * - * @param farmBeatsSolutionIds Ids of FarmBeats Solutions which the customer requests to fetch. - * @param farmBeatsSolutionNames Names of FarmBeats Solutions which the customer requests to fetch. + * @param farmBeatsSolutionIds Ids of Data Manager For Agriculture Solutions which the customer requests to fetch. + * @param farmBeatsSolutionNames Names of Data Manager For Agriculture Solutions which the customer requests to + * fetch. * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of Data Manager For Agriculture solutions along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(List farmBeatsSolutionIds, - List farmBeatsSolutionNames, Integer maxPageSize, Context context) { + private Mono> listSinglePageAsync( + List farmBeatsSolutionIds, List farmBeatsSolutionNames, Integer maxPageSize, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -165,33 +169,34 @@ private Mono> listSinglePageAsync(List listAsync(List farmBeatsSolutionIds, + private PagedFlux listAsync(List farmBeatsSolutionIds, List farmBeatsSolutionNames, Integer maxPageSize) { return new PagedFlux<>(() -> listSinglePageAsync(farmBeatsSolutionIds, farmBeatsSolutionNames, maxPageSize), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions as paginated response with {@link PagedFlux}. + * @return list of Data Manager For Agriculture solutions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { final List farmBeatsSolutionIds = null; final List farmBeatsSolutionNames = null; final Integer maxPageSize = null; @@ -200,20 +205,21 @@ private PagedFlux listAsync() { } /** - * Get list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * - * @param farmBeatsSolutionIds Ids of FarmBeats Solutions which the customer requests to fetch. - * @param farmBeatsSolutionNames Names of FarmBeats Solutions which the customer requests to fetch. + * @param farmBeatsSolutionIds Ids of Data Manager For Agriculture Solutions which the customer requests to fetch. + * @param farmBeatsSolutionNames Names of Data Manager For Agriculture Solutions which the customer requests to + * fetch. * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions as paginated response with {@link PagedFlux}. + * @return list of Data Manager For Agriculture solutions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(List farmBeatsSolutionIds, + private PagedFlux listAsync(List farmBeatsSolutionIds, List farmBeatsSolutionNames, Integer maxPageSize, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(farmBeatsSolutionIds, farmBeatsSolutionNames, maxPageSize, context), @@ -221,14 +227,14 @@ private PagedFlux listAsync(List farmBeatsSoluti } /** - * Get list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { final List farmBeatsSolutionIds = null; final List farmBeatsSolutionNames = null; final Integer maxPageSize = null; @@ -236,117 +242,124 @@ public PagedIterable list() { } /** - * Get list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * - * @param farmBeatsSolutionIds Ids of FarmBeats Solutions which the customer requests to fetch. - * @param farmBeatsSolutionNames Names of FarmBeats Solutions which the customer requests to fetch. + * @param farmBeatsSolutionIds Ids of Data Manager For Agriculture Solutions which the customer requests to fetch. + * @param farmBeatsSolutionNames Names of Data Manager For Agriculture Solutions which the customer requests to + * fetch. * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(List farmBeatsSolutionIds, + public PagedIterable list(List farmBeatsSolutionIds, List farmBeatsSolutionNames, Integer maxPageSize, Context context) { return new PagedIterable<>(listAsync(farmBeatsSolutionIds, farmBeatsSolutionNames, maxPageSize, context)); } /** - * Get farmBeats solution by id. + * Get Data Manager For Agriculture solution by id. * - * @param farmBeatsSolutionId farmBeatsSolutionId to be queried. + * @param dataManagerForAgricultureSolutionId dataManagerForAgricultureSolutionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats solution by id along with {@link Response} on successful completion of {@link Mono}. + * @return data Manager For Agriculture solution by id along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String farmBeatsSolutionId) { + private Mono> + getWithResponseAsync(String dataManagerForAgricultureSolutionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (farmBeatsSolutionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsSolutionId is required and cannot be null.")); + if (dataManagerForAgricultureSolutionId == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureSolutionId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), farmBeatsSolutionId, + .withContext(context -> service.get(this.client.getEndpoint(), dataManagerForAgricultureSolutionId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get farmBeats solution by id. + * Get Data Manager For Agriculture solution by id. * - * @param farmBeatsSolutionId farmBeatsSolutionId to be queried. + * @param dataManagerForAgricultureSolutionId dataManagerForAgricultureSolutionId to be queried. * @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 farmBeats solution by id along with {@link Response} on successful completion of {@link Mono}. + * @return data Manager For Agriculture solution by id along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String farmBeatsSolutionId, Context context) { + private Mono> + getWithResponseAsync(String dataManagerForAgricultureSolutionId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (farmBeatsSolutionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsSolutionId is required and cannot be null.")); + if (dataManagerForAgricultureSolutionId == null) { + return Mono.error(new IllegalArgumentException( + "Parameter dataManagerForAgricultureSolutionId is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), farmBeatsSolutionId, this.client.getApiVersion(), accept, - context); + return service.get(this.client.getEndpoint(), dataManagerForAgricultureSolutionId, this.client.getApiVersion(), + accept, context); } /** - * Get farmBeats solution by id. + * Get Data Manager For Agriculture solution by id. * - * @param farmBeatsSolutionId farmBeatsSolutionId to be queried. + * @param dataManagerForAgricultureSolutionId dataManagerForAgricultureSolutionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats solution by id on successful completion of {@link Mono}. + * @return data Manager For Agriculture solution by id on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String farmBeatsSolutionId) { - return getWithResponseAsync(farmBeatsSolutionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String dataManagerForAgricultureSolutionId) { + return getWithResponseAsync(dataManagerForAgricultureSolutionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get farmBeats solution by id. + * Get Data Manager For Agriculture solution by id. * - * @param farmBeatsSolutionId farmBeatsSolutionId to be queried. + * @param dataManagerForAgricultureSolutionId dataManagerForAgricultureSolutionId to be queried. * @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 farmBeats solution by id along with {@link Response}. + * @return data Manager For Agriculture solution by id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String farmBeatsSolutionId, Context context) { - return getWithResponseAsync(farmBeatsSolutionId, context).block(); + public Response getWithResponse(String dataManagerForAgricultureSolutionId, + Context context) { + return getWithResponseAsync(dataManagerForAgricultureSolutionId, context).block(); } /** - * Get farmBeats solution by id. + * Get Data Manager For Agriculture solution by id. * - * @param farmBeatsSolutionId farmBeatsSolutionId to be queried. + * @param dataManagerForAgricultureSolutionId dataManagerForAgricultureSolutionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats solution by id. + * @return data Manager For Agriculture solution by id. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsSolutionInner get(String farmBeatsSolutionId) { - return getWithResponse(farmBeatsSolutionId, Context.NONE).getValue(); + public DataManagerForAgricultureSolutionInner get(String dataManagerForAgricultureSolutionId) { + return getWithResponse(dataManagerForAgricultureSolutionId, Context.NONE).getValue(); } /** @@ -360,7 +373,7 @@ public FarmBeatsSolutionInner get(String farmBeatsSolutionId) { * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -370,7 +383,7 @@ private Mono> listNextSinglePageAsync(Stri } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + .>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())); } @@ -387,7 +400,8 @@ private Mono> listNextSinglePageAsync(Stri * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesImpl.java index 508a32604b00..b21ff194d372 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesImpl.java @@ -10,8 +10,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.agrifood.fluent.SolutionsDiscoverabilitiesClient; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsSolutionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsSolution; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureSolutionInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureSolution; import com.azure.resourcemanager.agrifood.models.SolutionsDiscoverabilities; import java.util.List; @@ -28,32 +28,36 @@ public SolutionsDiscoverabilitiesImpl(SolutionsDiscoverabilitiesClient innerClie this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FarmBeatsSolutionImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DataManagerForAgricultureSolutionImpl(inner1, this.manager())); } - public PagedIterable list(List farmBeatsSolutionIds, List farmBeatsSolutionNames, - Integer maxPageSize, Context context) { - PagedIterable inner + public PagedIterable list(List farmBeatsSolutionIds, + List farmBeatsSolutionNames, Integer maxPageSize, Context context) { + PagedIterable inner = this.serviceClient().list(farmBeatsSolutionIds, farmBeatsSolutionNames, maxPageSize, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FarmBeatsSolutionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DataManagerForAgricultureSolutionImpl(inner1, this.manager())); } - public Response getWithResponse(String farmBeatsSolutionId, Context context) { - Response inner = this.serviceClient().getWithResponse(farmBeatsSolutionId, context); + public Response getWithResponse(String dataManagerForAgricultureSolutionId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(dataManagerForAgricultureSolutionId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FarmBeatsSolutionImpl(inner.getValue(), this.manager())); + new DataManagerForAgricultureSolutionImpl(inner.getValue(), this.manager())); } else { return null; } } - public FarmBeatsSolution get(String farmBeatsSolutionId) { - FarmBeatsSolutionInner inner = this.serviceClient().get(farmBeatsSolutionId); + public DataManagerForAgricultureSolution get(String dataManagerForAgricultureSolutionId) { + DataManagerForAgricultureSolutionInner inner = this.serviceClient().get(dataManagerForAgricultureSolutionId); if (inner != null) { - return new FarmBeatsSolutionImpl(inner, this.manager()); + return new DataManagerForAgricultureSolutionImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsImpl.java index 0fe14fc7c6b9..936f860bad59 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsImpl.java @@ -29,10 +29,10 @@ public SolutionsImpl(SolutionsClient innerClient, this.serviceManager = serviceManager; } - public Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, String solutionId, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, context); + public Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SolutionImpl(inner.getValue(), this.manager())); @@ -41,8 +41,9 @@ public Response getWithResponse(String resourceGroupName, String farmB } } - public Solution get(String resourceGroupName, String farmBeatsResourceName, String solutionId) { - SolutionInner inner = this.serviceClient().get(resourceGroupName, farmBeatsResourceName, solutionId); + public Solution get(String resourceGroupName, String dataManagerForAgricultureResourceName, String solutionId) { + SolutionInner inner + = this.serviceClient().get(resourceGroupName, dataManagerForAgricultureResourceName, solutionId); if (inner != null) { return new SolutionImpl(inner, this.manager()); } else { @@ -50,29 +51,31 @@ public Solution get(String resourceGroupName, String farmBeatsResourceName, Stri } } - public Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, String solutionId, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, context); + public Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, context); } - public void delete(String resourceGroupName, String farmBeatsResourceName, String solutionId) { - this.serviceClient().delete(resourceGroupName, farmBeatsResourceName, solutionId); + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String solutionId) { + this.serviceClient().delete(resourceGroupName, dataManagerForAgricultureResourceName, solutionId); } - public PagedIterable list(String resourceGroupName, String farmBeatsResourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, farmBeatsResourceName); + public PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, dataManagerForAgricultureResourceName); return ResourceManagerUtils.mapPage(inner, inner1 -> new SolutionImpl(inner1, this.manager())); } - public PagedIterable list(String resourceGroupName, String farmBeatsResourceName, + public PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName, List solutionIds, List ids, List names, List propertyFilters, List statuses, OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, OffsetDateTime minLastModifiedDateTime, OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, String skipToken, Context context) { PagedIterable inner = this.serviceClient() - .list(resourceGroupName, farmBeatsResourceName, solutionIds, ids, names, propertyFilters, statuses, - minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, - skipToken, context); + .list(resourceGroupName, dataManagerForAgricultureResourceName, solutionIds, ids, names, propertyFilters, + statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, + maxPageSize, skipToken, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new SolutionImpl(inner1, this.manager())); } @@ -82,8 +85,8 @@ public Solution getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -92,7 +95,8 @@ public Solution getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'solutions'.", id))); } - return this.getWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, Context.NONE) + .getValue(); } public Response getByIdWithResponse(String id, Context context) { @@ -101,8 +105,8 @@ public Response getByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -111,7 +115,7 @@ public Response getByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'solutions'.", id))); } - return this.getWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, context); + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, context); } public void deleteById(String id) { @@ -120,8 +124,8 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -130,7 +134,7 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'solutions'.", id))); } - this.deleteWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, Context.NONE); + this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { @@ -139,8 +143,8 @@ public Response deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String farmBeatsResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); - if (farmBeatsResourceName == null) { + String dataManagerForAgricultureResourceName = ResourceManagerUtils.getValueFromIdByName(id, "farmBeats"); + if (dataManagerForAgricultureResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'farmBeats'.", id))); } @@ -149,7 +153,7 @@ public Response deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'solutions'.", id))); } - return this.deleteWithResponse(resourceGroupName, farmBeatsResourceName, solutionId, context); + return this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, context); } private SolutionsClient serviceClient() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/package-info.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/package-info.java index 9b4eb9c3f56e..9d5a4f71737a 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/package-info.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the implementations for AgriFoodManagementClient. - * APIs documentation for Azure AgFoodPlatform Resource Provider Service. + * APIs documentation for Microsoft Azure Data Manager for Agriculture Service. */ package com.azure.resourcemanager.agrifood.implementation; diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ApiKeyAuthCredentials.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ApiKeyAuthCredentials.java new file mode 100644 index 000000000000..566a2f70b4c6 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ApiKeyAuthCredentials.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.agrifood.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ApiKeyAuthCredentials class for ApiKey based Auth. + */ +@Fluent +public final class ApiKeyAuthCredentials extends AuthCredentials { + /* + * Enum for different types of AuthCredentials supported. + */ + private AuthCredentialsKind kind = AuthCredentialsKind.API_KEY_AUTH_CREDENTIALS; + + /* + * Properties of the key vault. + */ + private KeyVaultProperties apiKey; + + /** + * Creates an instance of ApiKeyAuthCredentials class. + */ + public ApiKeyAuthCredentials() { + } + + /** + * Get the kind property: Enum for different types of AuthCredentials supported. + * + * @return the kind value. + */ + @Override + public AuthCredentialsKind kind() { + return this.kind; + } + + /** + * Get the apiKey property: Properties of the key vault. + * + * @return the apiKey value. + */ + public KeyVaultProperties apiKey() { + return this.apiKey; + } + + /** + * Set the apiKey property: Properties of the key vault. + * + * @param apiKey the apiKey value to set. + * @return the ApiKeyAuthCredentials object itself. + */ + public ApiKeyAuthCredentials withApiKey(KeyVaultProperties apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (apiKey() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property apiKey in model ApiKeyAuthCredentials")); + } else { + apiKey().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApiKeyAuthCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("apiKey", this.apiKey); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeyAuthCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyAuthCredentials if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiKeyAuthCredentials. + */ + public static ApiKeyAuthCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyAuthCredentials deserializedApiKeyAuthCredentials = new ApiKeyAuthCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("apiKey".equals(fieldName)) { + deserializedApiKeyAuthCredentials.apiKey = KeyVaultProperties.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedApiKeyAuthCredentials.kind = AuthCredentialsKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyAuthCredentials; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentials.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentials.java new file mode 100644 index 000000000000..228a4beb355a --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentials.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * AuthCredentials abstract base class for Auth Purpose. + */ +@Immutable +public class AuthCredentials implements JsonSerializable { + /* + * Enum for different types of AuthCredentials supported. + */ + private AuthCredentialsKind kind = AuthCredentialsKind.fromString("AuthCredentials"); + + /** + * Creates an instance of AuthCredentials class. + */ + public AuthCredentials() { + } + + /** + * Get the kind property: Enum for different types of AuthCredentials supported. + * + * @return the kind value. + */ + public AuthCredentialsKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthCredentials if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthCredentials. + */ + public static AuthCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ApiKeyAuthCredentials".equals(discriminatorValue)) { + return ApiKeyAuthCredentials.fromJson(readerToUse.reset()); + } else if ("OAuthClientCredentials".equals(discriminatorValue)) { + return OAuthClientCredentials.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static AuthCredentials fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthCredentials deserializedAuthCredentials = new AuthCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAuthCredentials.kind = AuthCredentialsKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthCredentials; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentialsKind.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentialsKind.java new file mode 100644 index 000000000000..c7522f604d69 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentialsKind.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum for different types of AuthCredentials supported. + */ +public final class AuthCredentialsKind extends ExpandableStringEnum { + /** + * Static value OAuthClientCredentials for AuthCredentialsKind. + */ + public static final AuthCredentialsKind OAUTH_CLIENT_CREDENTIALS = fromString("OAuthClientCredentials"); + + /** + * Static value ApiKeyAuthCredentials for AuthCredentialsKind. + */ + public static final AuthCredentialsKind API_KEY_AUTH_CREDENTIALS = fromString("ApiKeyAuthCredentials"); + + /** + * Creates a new instance of AuthCredentialsKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthCredentialsKind() { + } + + /** + * Creates or finds a AuthCredentialsKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthCredentialsKind. + */ + public static AuthCredentialsKind fromString(String name) { + return fromString(name, AuthCredentialsKind.class); + } + + /** + * Gets known AuthCredentialsKind values. + * + * @return known AuthCredentialsKind values. + */ + public static Collection values() { + return values(AuthCredentialsKind.class); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Locations.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilities.java similarity index 75% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Locations.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilities.java index 51a07805cf5a..5be3ab713d13 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Locations.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilities.java @@ -8,30 +8,30 @@ import com.azure.core.util.Context; /** - * Resource collection API of Locations. + * Resource collection API of CheckNameAvailabilities. */ -public interface Locations { +public interface CheckNameAvailabilities { /** * Checks the name availability of the resource with requested resource name. * - * @param body NameAvailabilityRequest object. + * @param nameAvailabilityRequest NameAvailabilityRequest object. * @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 check availability result along with {@link Response}. */ - Response checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body, - Context context); + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context); /** * Checks the name availability of the resource with requested resource name. * - * @param body NameAvailabilityRequest object. + * @param nameAvailabilityRequest NameAvailabilityRequest object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the check availability result. */ - CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest body); + CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest nameAvailabilityRequest); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnector.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnector.java new file mode 100644 index 000000000000..c2f95ebe46a7 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnector.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.agrifood.fluent.models.DataConnectorInner; + +/** + * An immutable client-side representation of DataConnector. + */ +public interface DataConnector { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: DataConnector Properties. + * + * @return the properties value. + */ + DataConnectorProperties properties(); + + /** + * Gets the etag property: The ETag value to implement optimistic concurrency. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.DataConnectorInner object. + * + * @return the inner object. + */ + DataConnectorInner innerModel(); + + /** + * The entirety of the DataConnector definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The DataConnector definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DataConnector definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DataConnector definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, dataManagerForAgricultureResourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @return the next definition stage. + */ + WithProperties withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName); + } + + /** + * The stage of the DataConnector definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: DataConnector Properties.. + * + * @param properties DataConnector Properties. + * @return the next definition stage. + */ + WithCreate withProperties(DataConnectorProperties properties); + } + + /** + * The stage of the DataConnector 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. + */ + DataConnector create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataConnector create(Context context); + } + } + + /** + * Begins update for the DataConnector resource. + * + * @return the stage of resource update. + */ + DataConnector.Update update(); + + /** + * The template for DataConnector update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataConnector apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataConnector apply(Context context); + } + + /** + * The DataConnector update stages. + */ + interface UpdateStages { + /** + * The stage of the DataConnector update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: DataConnector Properties.. + * + * @param properties DataConnector Properties. + * @return the next definition stage. + */ + Update withProperties(DataConnectorProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataConnector refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataConnector refresh(Context context); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtensionListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorListResponse.java similarity index 52% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtensionListResponse.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorListResponse.java index 7c454d0b2974..2f18f720fb40 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtensionListResponse.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorListResponse.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.agrifood.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner; +import com.azure.resourcemanager.agrifood.fluent.models.DataConnectorInner; import java.io.IOException; import java.util.List; @@ -17,11 +18,11 @@ * Paged response contains list of requested objects and a URL link to get the next set of results. */ @Fluent -public final class FarmBeatsExtensionListResponse implements JsonSerializable { +public final class DataConnectorListResponse implements JsonSerializable { /* * List of requested objects. */ - private List value; + private List value; /* * Continuation link (absolute URI) to the next page of results in the list. @@ -29,9 +30,9 @@ public final class FarmBeatsExtensionListResponse implements JsonSerializable value() { + public List value() { return this.value; } @@ -47,9 +48,9 @@ public List value() { * Set the value property: List of requested objects. * * @param value the value value to set. - * @return the FarmBeatsExtensionListResponse object itself. + * @return the DataConnectorListResponse object itself. */ - public FarmBeatsExtensionListResponse withValue(List value) { + public DataConnectorListResponse withValue(List value) { this.value = value; return this; } @@ -63,17 +64,34 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: Continuation link (absolute URI) to the next page of results in the list. + * + * @param nextLink the nextLink value to set. + * @return the DataConnectorListResponse object itself. + */ + public DataConnectorListResponse 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) { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model DataConnectorListResponse")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(DataConnectorListResponse.class); + /** * {@inheritDoc} */ @@ -81,37 +99,37 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } /** - * Reads an instance of FarmBeatsExtensionListResponse from the JsonReader. + * Reads an instance of DataConnectorListResponse from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsExtensionListResponse if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the FarmBeatsExtensionListResponse. + * @return An instance of DataConnectorListResponse if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataConnectorListResponse. */ - public static FarmBeatsExtensionListResponse fromJson(JsonReader jsonReader) throws IOException { + public static DataConnectorListResponse fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FarmBeatsExtensionListResponse deserializedFarmBeatsExtensionListResponse - = new FarmBeatsExtensionListResponse(); + DataConnectorListResponse deserializedDataConnectorListResponse = new DataConnectorListResponse(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> FarmBeatsExtensionInner.fromJson(reader1)); - deserializedFarmBeatsExtensionListResponse.value = value; + List value = reader.readArray(reader1 -> DataConnectorInner.fromJson(reader1)); + deserializedDataConnectorListResponse.value = value; } else if ("nextLink".equals(fieldName)) { - deserializedFarmBeatsExtensionListResponse.nextLink = reader.getString(); + deserializedDataConnectorListResponse.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedFarmBeatsExtensionListResponse; + return deserializedDataConnectorListResponse; }); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorProperties.java new file mode 100644 index 000000000000..fe9a72aaf7fb --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * DataConnector Properties. + */ +@Fluent +public final class DataConnectorProperties implements JsonSerializable { + /* + * AuthCredentials abstract base class for Auth Purpose. + */ + private AuthCredentials credentials; + + /** + * Creates an instance of DataConnectorProperties class. + */ + public DataConnectorProperties() { + } + + /** + * Get the credentials property: AuthCredentials abstract base class for Auth Purpose. + * + * @return the credentials value. + */ + public AuthCredentials credentials() { + return this.credentials; + } + + /** + * Set the credentials property: AuthCredentials abstract base class for Auth Purpose. + * + * @param credentials the credentials value to set. + * @return the DataConnectorProperties object itself. + */ + public DataConnectorProperties withCredentials(AuthCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property credentials in model DataConnectorProperties")); + } else { + credentials().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataConnectorProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectorProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataConnectorProperties. + */ + public static DataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectorProperties deserializedDataConnectorProperties = new DataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentials".equals(fieldName)) { + deserializedDataConnectorProperties.credentials = AuthCredentials.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataConnectorProperties; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectors.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectors.java new file mode 100644 index 000000000000..8cd4e340fcf0 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectors.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.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 DataConnectors. + */ +public interface DataConnectors { + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 specific Data Connector resource by DataConnectorName along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName, Context context); + + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 specific Data Connector resource by DataConnectorName. + */ + DataConnector get(String resourceGroupName, String dataManagerForAgricultureResourceName, String dataConnectorName); + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String dataConnectorName, Context context); + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param dataConnectorName Connector 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String dataConnectorName); + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 paged response contains list of requested objects and a URL link to get the next set of results as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName); + + /** + * Lists the Data Connector Credentials for MADMA instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Continuation token for getting next set of results. + * @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 paged response contains list of requested objects and a URL link to get the next set of results as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName, + Integer maxPageSize, String skipToken, Context context); + + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @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 specific Data Connector resource by DataConnectorName along with {@link Response}. + */ + DataConnector getById(String id); + + /** + * Get specific Data Connector resource by DataConnectorName. + * + * @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 specific Data Connector resource by DataConnectorName along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Data Connectors with given dataConnector name. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @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 DataConnector resource. + * + * @param name resource name. + * @return the first stage of the new DataConnector definition. + */ + DataConnector.DefinitionStages.Blank define(String name); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeats.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgriculture.java similarity index 71% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeats.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgriculture.java index 51e7a72ef75a..b18cbfd2fa06 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeats.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgriculture.java @@ -7,13 +7,14 @@ import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner; +import java.util.List; import java.util.Map; /** - * An immutable client-side representation of FarmBeats. + * An immutable client-side representation of DataManagerForAgriculture. */ -public interface FarmBeats { +public interface DataManagerForAgriculture { /** * Gets the id property: Fully qualified resource Id for the resource. * @@ -64,14 +65,14 @@ public interface FarmBeats { SystemData systemData(); /** - * Gets the instanceUri property: Uri of the FarmBeats instance. + * Gets the instanceUri property: Uri of the Data Manager For Agriculture instance. * * @return the instanceUri value. */ String instanceUri(); /** - * Gets the provisioningState property: FarmBeats instance provisioning state. + * Gets the provisioningState property: Data Manager For Agriculture instance provisioning state. * * @return the provisioningState value. */ @@ -85,18 +86,19 @@ public interface FarmBeats { SensorIntegration sensorIntegration(); /** - * Gets the publicNetworkAccess property: Property to allow or block public traffic for an Azure FarmBeats resource. + * Gets the publicNetworkAccess property: Property to allow or block public traffic for an Azure Data Manager For + * Agriculture resource. * * @return the publicNetworkAccess value. */ PublicNetworkAccess publicNetworkAccess(); /** - * Gets the privateEndpointConnections property: The private endpoint connection resource. + * Gets the privateEndpointConnections property: Private endpoints. * * @return the privateEndpointConnections value. */ - PrivateEndpointConnection privateEndpointConnections(); + List privateEndpointConnections(); /** * Gets the region of the resource. @@ -120,31 +122,31 @@ public interface FarmBeats { String resourceGroupName(); /** - * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner object. + * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner object. * * @return the inner object. */ - FarmBeatsInner innerModel(); + DataManagerForAgricultureInner innerModel(); /** - * The entirety of the FarmBeats definition. + * The entirety of the DataManagerForAgriculture definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } /** - * The FarmBeats definition stages. + * The DataManagerForAgriculture definition stages. */ interface DefinitionStages { /** - * The first stage of the FarmBeats definition. + * The first stage of the DataManagerForAgriculture definition. */ interface Blank extends WithLocation { } /** - * The stage of the FarmBeats definition allowing to specify location. + * The stage of the DataManagerForAgriculture definition allowing to specify location. */ interface WithLocation { /** @@ -165,7 +167,7 @@ interface WithLocation { } /** - * The stage of the FarmBeats definition allowing to specify parent resource. + * The stage of the DataManagerForAgriculture definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -178,8 +180,8 @@ interface WithResourceGroup { } /** - * The stage of the FarmBeats 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. + * The stage of the DataManagerForAgriculture definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithSensorIntegration, DefinitionStages.WithPublicNetworkAccess { @@ -188,7 +190,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIde * * @return the created resource. */ - FarmBeats create(); + DataManagerForAgriculture create(); /** * Executes the create request. @@ -196,11 +198,11 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIde * @param context The context to associate with this operation. * @return the created resource. */ - FarmBeats create(Context context); + DataManagerForAgriculture create(Context context); } /** - * The stage of the FarmBeats definition allowing to specify tags. + * The stage of the DataManagerForAgriculture definition allowing to specify tags. */ interface WithTags { /** @@ -213,7 +215,7 @@ interface WithTags { } /** - * The stage of the FarmBeats definition allowing to specify identity. + * The stage of the DataManagerForAgriculture definition allowing to specify identity. */ interface WithIdentity { /** @@ -226,7 +228,7 @@ interface WithIdentity { } /** - * The stage of the FarmBeats definition allowing to specify sensorIntegration. + * The stage of the DataManagerForAgriculture definition allowing to specify sensorIntegration. */ interface WithSensorIntegration { /** @@ -239,14 +241,15 @@ interface WithSensorIntegration { } /** - * The stage of the FarmBeats definition allowing to specify publicNetworkAccess. + * The stage of the DataManagerForAgriculture definition allowing to specify publicNetworkAccess. */ interface WithPublicNetworkAccess { /** - * Specifies the publicNetworkAccess property: Property to allow or block public traffic for an Azure - * FarmBeats resource.. + * Specifies the publicNetworkAccess property: Property to allow or block public traffic for an Azure Data + * Manager For Agriculture resource.. * - * @param publicNetworkAccess Property to allow or block public traffic for an Azure FarmBeats resource. + * @param publicNetworkAccess Property to allow or block public traffic for an Azure Data Manager For + * Agriculture resource. * @return the next definition stage. */ WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); @@ -254,14 +257,14 @@ interface WithPublicNetworkAccess { } /** - * Begins update for the FarmBeats resource. + * Begins update for the DataManagerForAgriculture resource. * * @return the stage of resource update. */ - FarmBeats.Update update(); + DataManagerForAgriculture.Update update(); /** - * The template for FarmBeats update. + * The template for DataManagerForAgriculture update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { /** @@ -269,7 +272,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, Updat * * @return the updated resource. */ - FarmBeats apply(); + DataManagerForAgriculture apply(); /** * Executes the update request. @@ -277,15 +280,15 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, Updat * @param context The context to associate with this operation. * @return the updated resource. */ - FarmBeats apply(Context context); + DataManagerForAgriculture apply(Context context); } /** - * The FarmBeats update stages. + * The DataManagerForAgriculture update stages. */ interface UpdateStages { /** - * The stage of the FarmBeats update allowing to specify tags. + * The stage of the DataManagerForAgriculture update allowing to specify tags. */ interface WithTags { /** @@ -298,7 +301,7 @@ interface WithTags { } /** - * The stage of the FarmBeats update allowing to specify identity. + * The stage of the DataManagerForAgriculture update allowing to specify identity. */ interface WithIdentity { /** @@ -311,16 +314,16 @@ interface WithIdentity { } /** - * The stage of the FarmBeats update allowing to specify properties. + * The stage of the DataManagerForAgriculture update allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: FarmBeats ARM Resource properties.. + * Specifies the properties property: Data Manager For Agriculture ARM Resource properties.. * - * @param properties FarmBeats ARM Resource properties. + * @param properties Data Manager For Agriculture ARM Resource properties. * @return the next definition stage. */ - Update withProperties(FarmBeatsUpdateProperties properties); + Update withProperties(DataManagerForAgricultureUpdateProperties properties); } } @@ -329,7 +332,7 @@ interface WithProperties { * * @return the refreshed resource. */ - FarmBeats refresh(); + DataManagerForAgriculture refresh(); /** * Refreshes the resource to sync with Azure. @@ -337,5 +340,5 @@ interface WithProperties { * @param context The context to associate with this operation. * @return the refreshed resource. */ - FarmBeats refresh(Context context); + DataManagerForAgriculture refresh(Context context); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtension.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtension.java new file mode 100644 index 000000000000..3a9dbe12de47 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtension.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureExtensionInner; + +/** + * An immutable client-side representation of DataManagerForAgricultureExtension. + */ +public interface DataManagerForAgricultureExtension { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: DataManagerForAgricultureExtension properties. + * + * @return the properties value. + */ + DataManagerForAgricultureExtensionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureExtensionInner object. + * + * @return the inner object. + */ + DataManagerForAgricultureExtensionInner innerModel(); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensionListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensionListResponse.java new file mode 100644 index 000000000000..9f9db51e135b --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensionListResponse.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.agrifood.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureExtensionInner; +import java.io.IOException; +import java.util.List; + +/** + * Paged response contains list of requested objects and a URL link to get the next set of results. + */ +@Fluent +public final class DataManagerForAgricultureExtensionListResponse + implements JsonSerializable { + /* + * List of requested objects. + */ + private List value; + + /* + * Token used in retrieving the next page. If null, there are no additional pages. + */ + private String skipToken; + + /* + * Continuation link (absolute URI) to the next page of results in the list. + */ + private String nextLink; + + /** + * Creates an instance of DataManagerForAgricultureExtensionListResponse class. + */ + public DataManagerForAgricultureExtensionListResponse() { + } + + /** + * Get the value property: List of requested objects. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of requested objects. + * + * @param value the value value to set. + * @return the DataManagerForAgricultureExtensionListResponse object itself. + */ + public DataManagerForAgricultureExtensionListResponse + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the skipToken property: Token used in retrieving the next page. If null, there are no additional pages. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: Token used in retrieving the next page. If null, there are no additional pages. + * + * @param skipToken the skipToken value to set. + * @return the DataManagerForAgricultureExtensionListResponse object itself. + */ + public DataManagerForAgricultureExtensionListResponse withSkipToken(String skipToken) { + this.skipToken = skipToken; + return this; + } + + /** + * Get the nextLink property: Continuation link (absolute URI) to the next page of results in the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Continuation link (absolute URI) to the next page of results in the list. + * + * @param nextLink the nextLink value to set. + * @return the DataManagerForAgricultureExtensionListResponse object itself. + */ + public DataManagerForAgricultureExtensionListResponse 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.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DataManagerForAgricultureExtensionListResponse")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataManagerForAgricultureExtensionListResponse.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("$skipToken", this.skipToken); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataManagerForAgricultureExtensionListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataManagerForAgricultureExtensionListResponse if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureExtensionListResponse. + */ + public static DataManagerForAgricultureExtensionListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataManagerForAgricultureExtensionListResponse deserializedDataManagerForAgricultureExtensionListResponse + = new DataManagerForAgricultureExtensionListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DataManagerForAgricultureExtensionInner.fromJson(reader1)); + deserializedDataManagerForAgricultureExtensionListResponse.value = value; + } else if ("$skipToken".equals(fieldName)) { + deserializedDataManagerForAgricultureExtensionListResponse.skipToken = reader.getString(); + } else if ("nextLink".equals(fieldName)) { + deserializedDataManagerForAgricultureExtensionListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataManagerForAgricultureExtensionListResponse; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsExtensionProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensionProperties.java similarity index 62% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsExtensionProperties.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensionProperties.java index 028e563b3fd1..a5bf41287b8c 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsExtensionProperties.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensionProperties.java @@ -2,39 +2,39 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.agrifood.fluent.models; +package com.azure.resourcemanager.agrifood.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.agrifood.models.DetailedInformation; import java.io.IOException; import java.util.List; /** - * FarmBeatsExtension properties. + * DataManagerForAgricultureExtension properties. */ @Immutable -public final class FarmBeatsExtensionProperties implements JsonSerializable { +public final class DataManagerForAgricultureExtensionProperties + implements JsonSerializable { /* - * Target ResourceType of the farmBeatsExtension. + * Target ResourceType of the Data Manager For Agriculture Extension. */ private String targetResourceType; /* - * FarmBeatsExtension ID. + * Data Manager For Agriculture Extension ID. */ private String farmBeatsExtensionId; /* - * FarmBeatsExtension name. + * Data Manager For Agriculture Extension name. */ private String farmBeatsExtensionName; /* - * FarmBeatsExtension version. + * Data Manager For Agriculture Extension version. */ private String farmBeatsExtensionVersion; @@ -54,12 +54,12 @@ public final class FarmBeatsExtensionProperties implements JsonSerializable detailedInformation; /** - * Creates an instance of FarmBeatsExtensionProperties class. + * Creates an instance of DataManagerForAgricultureExtensionProperties class. */ - public FarmBeatsExtensionProperties() { + public DataManagerForAgricultureExtensionProperties() { } /** - * Get the targetResourceType property: Target ResourceType of the farmBeatsExtension. + * Get the targetResourceType property: Target ResourceType of the Data Manager For Agriculture Extension. * * @return the targetResourceType value. */ @@ -87,7 +87,7 @@ public String targetResourceType() { } /** - * Get the farmBeatsExtensionId property: FarmBeatsExtension ID. + * Get the farmBeatsExtensionId property: Data Manager For Agriculture Extension ID. * * @return the farmBeatsExtensionId value. */ @@ -96,7 +96,7 @@ public String farmBeatsExtensionId() { } /** - * Get the farmBeatsExtensionName property: FarmBeatsExtension name. + * Get the farmBeatsExtensionName property: Data Manager For Agriculture Extension name. * * @return the farmBeatsExtensionName value. */ @@ -105,7 +105,7 @@ public String farmBeatsExtensionName() { } /** - * Get the farmBeatsExtensionVersion property: FarmBeatsExtension version. + * Get the farmBeatsExtensionVersion property: Data Manager For Agriculture Extension version. * * @return the farmBeatsExtensionVersion value. */ @@ -141,7 +141,7 @@ public String extensionCategory() { } /** - * Get the extensionAuthLink property: FarmBeatsExtension auth link. + * Get the extensionAuthLink property: Data Manager For Agriculture Extension auth link. * * @return the extensionAuthLink value. */ @@ -150,7 +150,7 @@ public String extensionAuthLink() { } /** - * Get the extensionApiDocsLink property: FarmBeatsExtension api docs link. + * Get the extensionApiDocsLink property: Data Manager For Agriculture Extension api docs link. * * @return the extensionApiDocsLink value. */ @@ -191,48 +191,51 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FarmBeatsExtensionProperties from the JsonReader. + * Reads an instance of DataManagerForAgricultureExtensionProperties from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsExtensionProperties if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the FarmBeatsExtensionProperties. + * @return An instance of DataManagerForAgricultureExtensionProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureExtensionProperties. */ - public static FarmBeatsExtensionProperties fromJson(JsonReader jsonReader) throws IOException { + public static DataManagerForAgricultureExtensionProperties fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FarmBeatsExtensionProperties deserializedFarmBeatsExtensionProperties = new FarmBeatsExtensionProperties(); + DataManagerForAgricultureExtensionProperties deserializedDataManagerForAgricultureExtensionProperties + = new DataManagerForAgricultureExtensionProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("targetResourceType".equals(fieldName)) { - deserializedFarmBeatsExtensionProperties.targetResourceType = reader.getString(); + deserializedDataManagerForAgricultureExtensionProperties.targetResourceType = reader.getString(); } else if ("farmBeatsExtensionId".equals(fieldName)) { - deserializedFarmBeatsExtensionProperties.farmBeatsExtensionId = reader.getString(); + deserializedDataManagerForAgricultureExtensionProperties.farmBeatsExtensionId = reader.getString(); } else if ("farmBeatsExtensionName".equals(fieldName)) { - deserializedFarmBeatsExtensionProperties.farmBeatsExtensionName = reader.getString(); + deserializedDataManagerForAgricultureExtensionProperties.farmBeatsExtensionName + = reader.getString(); } else if ("farmBeatsExtensionVersion".equals(fieldName)) { - deserializedFarmBeatsExtensionProperties.farmBeatsExtensionVersion = reader.getString(); + deserializedDataManagerForAgricultureExtensionProperties.farmBeatsExtensionVersion + = reader.getString(); } else if ("publisherId".equals(fieldName)) { - deserializedFarmBeatsExtensionProperties.publisherId = reader.getString(); + deserializedDataManagerForAgricultureExtensionProperties.publisherId = reader.getString(); } else if ("description".equals(fieldName)) { - deserializedFarmBeatsExtensionProperties.description = reader.getString(); + deserializedDataManagerForAgricultureExtensionProperties.description = reader.getString(); } else if ("extensionCategory".equals(fieldName)) { - deserializedFarmBeatsExtensionProperties.extensionCategory = reader.getString(); + deserializedDataManagerForAgricultureExtensionProperties.extensionCategory = reader.getString(); } else if ("extensionAuthLink".equals(fieldName)) { - deserializedFarmBeatsExtensionProperties.extensionAuthLink = reader.getString(); + deserializedDataManagerForAgricultureExtensionProperties.extensionAuthLink = reader.getString(); } else if ("extensionApiDocsLink".equals(fieldName)) { - deserializedFarmBeatsExtensionProperties.extensionApiDocsLink = reader.getString(); + deserializedDataManagerForAgricultureExtensionProperties.extensionApiDocsLink = reader.getString(); } else if ("detailedInformation".equals(fieldName)) { List detailedInformation = reader.readArray(reader1 -> DetailedInformation.fromJson(reader1)); - deserializedFarmBeatsExtensionProperties.detailedInformation = detailedInformation; + deserializedDataManagerForAgricultureExtensionProperties.detailedInformation = detailedInformation; } else { reader.skipChildren(); } } - return deserializedFarmBeatsExtensionProperties; + return deserializedDataManagerForAgricultureExtensionProperties; }); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtensions.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensions.java similarity index 54% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtensions.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensions.java index d2c79342966b..ee11aeb15b96 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtensions.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensions.java @@ -10,23 +10,23 @@ import java.util.List; /** - * Resource collection API of FarmBeatsExtensions. + * Resource collection API of DataManagerForAgricultureExtensions. */ -public interface FarmBeatsExtensions { +public interface DataManagerForAgricultureExtensions { /** - * Get list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats extension as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture extension as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Get list of farmBeats extension. + * Get list of Data Manager For Agriculture extension. * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. + * @param farmBeatsExtensionIds DataManagerForAgricultureExtension ids. + * @param farmBeatsExtensionNames DataManagerForAgriculture extension names. * @param extensionCategories Extension categories. * @param publisherIds Publisher ids. * @param maxPageSize Maximum number of items needed (inclusive). @@ -35,31 +35,33 @@ public interface FarmBeatsExtensions { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats extension as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture extension as paginated response with {@link PagedIterable}. */ - PagedIterable list(List farmBeatsExtensionIds, List farmBeatsExtensionNames, - List extensionCategories, List publisherIds, Integer maxPageSize, Context context); + PagedIterable list(List farmBeatsExtensionIds, + List farmBeatsExtensionNames, List extensionCategories, List publisherIds, + Integer maxPageSize, Context context); /** - * Get farmBeats extension. + * Get Data Manager For Agriculture extension. * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param dataManagerForAgricultureExtensionId dataManagerForAgricultureExtensionId to be queried. * @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 farmBeats extension along with {@link Response}. + * @return data Manager For Agriculture extension along with {@link Response}. */ - Response getWithResponse(String farmBeatsExtensionId, Context context); + Response getWithResponse(String dataManagerForAgricultureExtensionId, + Context context); /** - * Get farmBeats extension. + * Get Data Manager For Agriculture extension. * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * @param dataManagerForAgricultureExtensionId dataManagerForAgricultureExtensionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats extension. + * @return data Manager For Agriculture extension. */ - FarmBeatsExtension get(String farmBeatsExtensionId); + DataManagerForAgricultureExtension get(String dataManagerForAgricultureExtensionId); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsSolutionListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureListResponse.java similarity index 58% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsSolutionListResponse.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureListResponse.java index d5c7353f46c5..3d4ec6252a5f 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsSolutionListResponse.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureListResponse.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.agrifood.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsSolutionInner; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner; import java.io.IOException; import java.util.List; @@ -17,11 +18,12 @@ * Paged response contains list of requested objects and a URL link to get the next set of results. */ @Fluent -public final class FarmBeatsSolutionListResponse implements JsonSerializable { +public final class DataManagerForAgricultureListResponse + implements JsonSerializable { /* * List of requested objects. */ - private List value; + private List value; /* * Token used in retrieving the next page. If null, there are no additional pages. @@ -34,9 +36,9 @@ public final class FarmBeatsSolutionListResponse implements JsonSerializable value() { + public List value() { return this.value; } @@ -52,9 +54,9 @@ public List value() { * Set the value property: List of requested objects. * * @param value the value value to set. - * @return the FarmBeatsSolutionListResponse object itself. + * @return the DataManagerForAgricultureListResponse object itself. */ - public FarmBeatsSolutionListResponse withValue(List value) { + public DataManagerForAgricultureListResponse withValue(List value) { this.value = value; return this; } @@ -72,9 +74,9 @@ public String skipToken() { * Set the skipToken property: Token used in retrieving the next page. If null, there are no additional pages. * * @param skipToken the skipToken value to set. - * @return the FarmBeatsSolutionListResponse object itself. + * @return the DataManagerForAgricultureListResponse object itself. */ - public FarmBeatsSolutionListResponse withSkipToken(String skipToken) { + public DataManagerForAgricultureListResponse withSkipToken(String skipToken) { this.skipToken = skipToken; return this; } @@ -92,9 +94,9 @@ public String nextLink() { * Set the nextLink property: Continuation link (absolute URI) to the next page of results in the list. * * @param nextLink the nextLink value to set. - * @return the FarmBeatsSolutionListResponse object itself. + * @return the DataManagerForAgricultureListResponse object itself. */ - public FarmBeatsSolutionListResponse withNextLink(String nextLink) { + public DataManagerForAgricultureListResponse withNextLink(String nextLink) { this.nextLink = nextLink; return this; } @@ -105,11 +107,17 @@ public FarmBeatsSolutionListResponse withNextLink(String nextLink) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DataManagerForAgricultureListResponse")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(DataManagerForAgricultureListResponse.class); + /** * {@inheritDoc} */ @@ -123,35 +131,36 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FarmBeatsSolutionListResponse from the JsonReader. + * Reads an instance of DataManagerForAgricultureListResponse from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsSolutionListResponse if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the FarmBeatsSolutionListResponse. + * @return An instance of DataManagerForAgricultureListResponse if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureListResponse. */ - public static FarmBeatsSolutionListResponse fromJson(JsonReader jsonReader) throws IOException { + public static DataManagerForAgricultureListResponse fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FarmBeatsSolutionListResponse deserializedFarmBeatsSolutionListResponse - = new FarmBeatsSolutionListResponse(); + DataManagerForAgricultureListResponse deserializedDataManagerForAgricultureListResponse + = new DataManagerForAgricultureListResponse(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> FarmBeatsSolutionInner.fromJson(reader1)); - deserializedFarmBeatsSolutionListResponse.value = value; + List value + = reader.readArray(reader1 -> DataManagerForAgricultureInner.fromJson(reader1)); + deserializedDataManagerForAgricultureListResponse.value = value; } else if ("$skipToken".equals(fieldName)) { - deserializedFarmBeatsSolutionListResponse.skipToken = reader.getString(); + deserializedDataManagerForAgricultureListResponse.skipToken = reader.getString(); } else if ("nextLink".equals(fieldName)) { - deserializedFarmBeatsSolutionListResponse.nextLink = reader.getString(); + deserializedDataManagerForAgricultureListResponse.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedFarmBeatsSolutionListResponse; + return deserializedDataManagerForAgricultureListResponse; }); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsModels.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureResources.java similarity index 71% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsModels.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureResources.java index 89dcb862ad48..d5e9887c7c30 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsModels.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureResources.java @@ -9,72 +9,73 @@ import com.azure.core.util.Context; /** - * Resource collection API of FarmBeatsModels. + * Resource collection API of DataManagerForAgricultureResources. */ -public interface FarmBeatsModels { +public interface DataManagerForAgricultureResources { /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeats resource along with {@link Response}. + * @return dataManagerForAgriculture resource along with {@link Response}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String farmBeatsResourceName, - Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context); /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 farmBeats resource. + * @return dataManagerForAgriculture resource. */ - FarmBeats getByResourceGroup(String resourceGroupName, String farmBeatsResourceName); + DataManagerForAgriculture getByResourceGroup(String resourceGroupName, + String dataManagerForAgricultureResourceName); /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 deleteByResourceGroupWithResponse(String resourceGroupName, String farmBeatsResourceName, - Context context); + Response deleteByResourceGroupWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context); /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 deleteByResourceGroup(String resourceGroupName, String farmBeatsResourceName); + void deleteByResourceGroup(String resourceGroupName, String dataManagerForAgricultureResourceName); /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged response contains list of requested objects and a URL link to get the next set of results as * paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Lists the FarmBeats instances for a subscription. + * Lists the DataManagerForAgriculture instances for a subscription. * * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. @@ -86,10 +87,10 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * @return paged response contains list of requested objects and a URL link to get the next set of results as * paginated response with {@link PagedIterable}. */ - PagedIterable list(Integer maxPageSize, String skipToken, Context context); + PagedIterable list(Integer maxPageSize, String skipToken, Context context); /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -98,10 +99,10 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * @return paged response contains list of requested objects and a URL link to get the next set of results as * paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists the FarmBeats instances for a resource group. + * Lists the DataManagerForAgriculture instances for a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param maxPageSize Maximum number of items needed (inclusive). @@ -114,34 +115,34 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin * @return paged response contains list of requested objects and a URL link to get the next set of results as * paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Integer maxPageSize, String skipToken, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Integer maxPageSize, + String skipToken, Context context); /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @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 farmBeats resource along with {@link Response}. + * @return dataManagerForAgriculture resource along with {@link Response}. */ - FarmBeats getById(String id); + DataManagerForAgriculture getById(String id); /** - * Get FarmBeats resource. + * Get DataManagerForAgriculture resource. * * @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 farmBeats resource along with {@link Response}. + * @return dataManagerForAgriculture resource along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -151,7 +152,7 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer m void deleteById(String id); /** - * Delete a FarmBeats resource. + * Delete a Data Manager For Agriculture resource. * * @param id the resource ID. * @param context The context to associate with this operation. @@ -163,10 +164,10 @@ PagedIterable listByResourceGroup(String resourceGroupName, Integer m Response deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new FarmBeats resource. + * Begins definition for a new DataManagerForAgriculture resource. * * @param name resource name. - * @return the first stage of the new FarmBeats definition. + * @return the first stage of the new DataManagerForAgriculture definition. */ - FarmBeats.DefinitionStages.Blank define(String name); + DataManagerForAgriculture.DefinitionStages.Blank define(String name); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsSolution.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolution.java similarity index 68% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsSolution.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolution.java index 41e9d84d2acc..7cb60cb05a96 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsSolution.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolution.java @@ -5,12 +5,12 @@ package com.azure.resourcemanager.agrifood.models; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsSolutionInner; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureSolutionInner; /** - * An immutable client-side representation of FarmBeatsSolution. + * An immutable client-side representation of DataManagerForAgricultureSolution. */ -public interface FarmBeatsSolution { +public interface DataManagerForAgricultureSolution { /** * Gets the id property: Fully qualified resource Id for the resource. * @@ -33,11 +33,11 @@ public interface FarmBeatsSolution { String type(); /** - * Gets the properties property: FarmBeatsSolution properties. + * Gets the properties property: DataManagerForAgricultureSolution properties. * * @return the properties value. */ - FarmBeatsSolutionProperties properties(); + DataManagerForAgricultureSolutionProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -47,9 +47,9 @@ public interface FarmBeatsSolution { SystemData systemData(); /** - * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsSolutionInner object. + * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureSolutionInner object. * * @return the inner object. */ - FarmBeatsSolutionInner innerModel(); + DataManagerForAgricultureSolutionInner innerModel(); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionListResponse.java new file mode 100644 index 000000000000..a106c89dff52 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionListResponse.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureSolutionInner; +import java.io.IOException; +import java.util.List; + +/** + * Paged response contains list of requested objects and a URL link to get the next set of results. + */ +@Fluent +public final class DataManagerForAgricultureSolutionListResponse + implements JsonSerializable { + /* + * List of requested objects. + */ + private List value; + + /* + * Token used in retrieving the next page. If null, there are no additional pages. + */ + private String skipToken; + + /* + * Continuation link (absolute URI) to the next page of results in the list. + */ + private String nextLink; + + /** + * Creates an instance of DataManagerForAgricultureSolutionListResponse class. + */ + public DataManagerForAgricultureSolutionListResponse() { + } + + /** + * Get the value property: List of requested objects. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of requested objects. + * + * @param value the value value to set. + * @return the DataManagerForAgricultureSolutionListResponse object itself. + */ + public DataManagerForAgricultureSolutionListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the skipToken property: Token used in retrieving the next page. If null, there are no additional pages. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: Token used in retrieving the next page. If null, there are no additional pages. + * + * @param skipToken the skipToken value to set. + * @return the DataManagerForAgricultureSolutionListResponse object itself. + */ + public DataManagerForAgricultureSolutionListResponse withSkipToken(String skipToken) { + this.skipToken = skipToken; + return this; + } + + /** + * Get the nextLink property: Continuation link (absolute URI) to the next page of results in the list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Continuation link (absolute URI) to the next page of results in the list. + * + * @param nextLink the nextLink value to set. + * @return the DataManagerForAgricultureSolutionListResponse object itself. + */ + public DataManagerForAgricultureSolutionListResponse 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.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DataManagerForAgricultureSolutionListResponse")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataManagerForAgricultureSolutionListResponse.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("$skipToken", this.skipToken); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataManagerForAgricultureSolutionListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataManagerForAgricultureSolutionListResponse if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureSolutionListResponse. + */ + public static DataManagerForAgricultureSolutionListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataManagerForAgricultureSolutionListResponse deserializedDataManagerForAgricultureSolutionListResponse + = new DataManagerForAgricultureSolutionListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DataManagerForAgricultureSolutionInner.fromJson(reader1)); + deserializedDataManagerForAgricultureSolutionListResponse.value = value; + } else if ("$skipToken".equals(fieldName)) { + deserializedDataManagerForAgricultureSolutionListResponse.skipToken = reader.getString(); + } else if ("nextLink".equals(fieldName)) { + deserializedDataManagerForAgricultureSolutionListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataManagerForAgricultureSolutionListResponse; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsSolutionProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionProperties.java similarity index 55% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsSolutionProperties.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionProperties.java index ef682684d2ba..4094c1954a5c 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsSolutionProperties.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionProperties.java @@ -15,10 +15,11 @@ import java.util.UUID; /** - * FarmBeatsSolution properties. + * DataManagerForAgricultureSolution properties. */ @Fluent -public final class FarmBeatsSolutionProperties implements JsonSerializable { +public final class DataManagerForAgricultureSolutionProperties + implements JsonSerializable { /* * Solution Partner Id. */ @@ -30,7 +31,8 @@ public final class FarmBeatsSolutionProperties implements JsonSerializable dataAccessScopes; @@ -41,34 +43,20 @@ public final class FarmBeatsSolutionProperties implements JsonSerializable inputParametersValidationScopes; - - /* - * Gets apiVersion: Swagger Document Dictionary to capture all api versions of swagger exposed by partner to - * farmbeats. + * Gets api-version Swagger Document Dictionary to capture all api-versions of swagger exposed by partner to Data + * Manager For Agriculture. */ private Map openApiSpecsDictionary; /* - * Gets example name: insight sample response Dictionary to capture all variations of computed results ingested by - * partner. - */ - private Map evaluatedOutputsDictionary; - - /* - * Application id of the multi tenant application to be used by partner to access FarmBeats data. + * Application id of the multi tenant application to be used by partner to access Data Manager For Agriculture data. */ private UUID accessFBApplicationId; /* * Application id of the SaaS multi tenant application. */ - private UUID saaSApplicationId; + private String saaSApplicationId; /* * List of ActionIds needed to make the SaaS multi tenant application access relevant fb data. @@ -86,14 +74,15 @@ public final class FarmBeatsSolutionProperties implements JsonSerializable inputParametersValidationScopes() { - return this.inputParametersValidationScopes; - } - - /** - * Get the openApiSpecsDictionary property: Gets apiVersion: Swagger Document Dictionary to capture all api versions - * of swagger exposed by partner to farmbeats. + * Get the openApiSpecsDictionary property: Gets api-version Swagger Document Dictionary to capture all api-versions + * of swagger exposed by partner to Data Manager For Agriculture. * * @return the openApiSpecsDictionary value. */ @@ -168,19 +145,9 @@ public Map openApiSpecsDictionary() { return this.openApiSpecsDictionary; } - /** - * Get the evaluatedOutputsDictionary property: Gets example name: insight sample response Dictionary to capture all - * variations of computed results ingested by partner. - * - * @return the evaluatedOutputsDictionary value. - */ - public Map evaluatedOutputsDictionary() { - return this.evaluatedOutputsDictionary; - } - /** * Get the accessFBApplicationId property: Application id of the multi tenant application to be used by partner to - * access FarmBeats data. + * access Data Manager For Agriculture data. * * @return the accessFBApplicationId value. */ @@ -193,7 +160,7 @@ public UUID accessFBApplicationId() { * * @return the saaSApplicationId value. */ - public UUID saaSApplicationId() { + public String saaSApplicationId() { return this.saaSApplicationId; } @@ -227,7 +194,7 @@ public String roleName() { /** * Get the accessFBApplicationName property: Application name of the multi tenant application to be used by partner - * to access FarmBeatsData. + * to access Data Manager For Agriculture Data. * * @return the accessFBApplicationName value. */ @@ -244,16 +211,6 @@ public void validate() { if (marketplaceOfferDetails() != null) { marketplaceOfferDetails().validate(); } - if (inputParametersValidationScopes() != null) { - inputParametersValidationScopes().forEach(e -> e.validate()); - } - if (evaluatedOutputsDictionary() != null) { - evaluatedOutputsDictionary().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } } /** @@ -267,63 +224,56 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FarmBeatsSolutionProperties from the JsonReader. + * Reads an instance of DataManagerForAgricultureSolutionProperties from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsSolutionProperties if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the FarmBeatsSolutionProperties. + * @return An instance of DataManagerForAgricultureSolutionProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureSolutionProperties. */ - public static FarmBeatsSolutionProperties fromJson(JsonReader jsonReader) throws IOException { + public static DataManagerForAgricultureSolutionProperties fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FarmBeatsSolutionProperties deserializedFarmBeatsSolutionProperties = new FarmBeatsSolutionProperties(); + DataManagerForAgricultureSolutionProperties deserializedDataManagerForAgricultureSolutionProperties + = new DataManagerForAgricultureSolutionProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("partnerId".equals(fieldName)) { - deserializedFarmBeatsSolutionProperties.partnerId = reader.getString(); + deserializedDataManagerForAgricultureSolutionProperties.partnerId = reader.getString(); } else if ("partnerTenantId".equals(fieldName)) { - deserializedFarmBeatsSolutionProperties.partnerTenantId = reader.getString(); + deserializedDataManagerForAgricultureSolutionProperties.partnerTenantId = reader.getString(); } else if ("dataAccessScopes".equals(fieldName)) { List dataAccessScopes = reader.readArray(reader1 -> reader1.getString()); - deserializedFarmBeatsSolutionProperties.dataAccessScopes = dataAccessScopes; + deserializedDataManagerForAgricultureSolutionProperties.dataAccessScopes = dataAccessScopes; } else if ("marketplaceOfferDetails".equals(fieldName)) { - deserializedFarmBeatsSolutionProperties.marketplaceOfferDetails + deserializedDataManagerForAgricultureSolutionProperties.marketplaceOfferDetails = MarketplaceOfferDetails.fromJson(reader); - } else if ("inputParametersValidationScopes".equals(fieldName)) { - List inputParametersValidationScopes - = reader.readArray(reader1 -> ResourceParameter.fromJson(reader1)); - deserializedFarmBeatsSolutionProperties.inputParametersValidationScopes - = inputParametersValidationScopes; } else if ("openApiSpecsDictionary".equals(fieldName)) { Map openApiSpecsDictionary = reader.readMap(reader1 -> reader1.readUntyped()); - deserializedFarmBeatsSolutionProperties.openApiSpecsDictionary = openApiSpecsDictionary; - } else if ("evaluatedOutputsDictionary".equals(fieldName)) { - Map evaluatedOutputsDictionary - = reader.readMap(reader1 -> SolutionEvaluatedOutput.fromJson(reader1)); - deserializedFarmBeatsSolutionProperties.evaluatedOutputsDictionary = evaluatedOutputsDictionary; + deserializedDataManagerForAgricultureSolutionProperties.openApiSpecsDictionary + = openApiSpecsDictionary; } else if ("accessFBApplicationId".equals(fieldName)) { - deserializedFarmBeatsSolutionProperties.accessFBApplicationId + deserializedDataManagerForAgricultureSolutionProperties.accessFBApplicationId = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); } else if ("saaSApplicationId".equals(fieldName)) { - deserializedFarmBeatsSolutionProperties.saaSApplicationId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedDataManagerForAgricultureSolutionProperties.saaSApplicationId = reader.getString(); } else if ("actionIds".equals(fieldName)) { List actionIds = reader.readArray(reader1 -> reader1.getString()); - deserializedFarmBeatsSolutionProperties.actionIds = actionIds; + deserializedDataManagerForAgricultureSolutionProperties.actionIds = actionIds; } else if ("roleId".equals(fieldName)) { - deserializedFarmBeatsSolutionProperties.roleId = reader.getString(); + deserializedDataManagerForAgricultureSolutionProperties.roleId = reader.getString(); } else if ("roleName".equals(fieldName)) { - deserializedFarmBeatsSolutionProperties.roleName = reader.getString(); + deserializedDataManagerForAgricultureSolutionProperties.roleName = reader.getString(); } else if ("accessFBApplicationName".equals(fieldName)) { - deserializedFarmBeatsSolutionProperties.accessFBApplicationName = reader.getString(); + deserializedDataManagerForAgricultureSolutionProperties.accessFBApplicationName + = reader.getString(); } else { reader.skipChildren(); } } - return deserializedFarmBeatsSolutionProperties; + return deserializedDataManagerForAgricultureSolutionProperties; }); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsUpdateProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureUpdateProperties.java similarity index 61% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsUpdateProperties.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureUpdateProperties.java index ac1092acdd9c..6839e7d1e1ed 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsUpdateProperties.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureUpdateProperties.java @@ -12,24 +12,25 @@ import java.io.IOException; /** - * FarmBeats ARM Resource properties. + * Data Manager For Agriculture ARM Resource properties. */ @Fluent -public final class FarmBeatsUpdateProperties implements JsonSerializable { +public final class DataManagerForAgricultureUpdateProperties + implements JsonSerializable { /* * Sensor integration request model. */ private SensorIntegration sensorIntegration; /* - * Property to allow or block public traffic for an Azure FarmBeats resource. + * Property to allow or block public traffic for an Azure Data Manager For Agriculture resource. */ private PublicNetworkAccess publicNetworkAccess; /** - * Creates an instance of FarmBeatsUpdateProperties class. + * Creates an instance of DataManagerForAgricultureUpdateProperties class. */ - public FarmBeatsUpdateProperties() { + public DataManagerForAgricultureUpdateProperties() { } /** @@ -45,15 +46,16 @@ public SensorIntegration sensorIntegration() { * Set the sensorIntegration property: Sensor integration request model. * * @param sensorIntegration the sensorIntegration value to set. - * @return the FarmBeatsUpdateProperties object itself. + * @return the DataManagerForAgricultureUpdateProperties object itself. */ - public FarmBeatsUpdateProperties withSensorIntegration(SensorIntegration sensorIntegration) { + public DataManagerForAgricultureUpdateProperties withSensorIntegration(SensorIntegration sensorIntegration) { this.sensorIntegration = sensorIntegration; return this; } /** - * Get the publicNetworkAccess property: Property to allow or block public traffic for an Azure FarmBeats resource. + * Get the publicNetworkAccess property: Property to allow or block public traffic for an Azure Data Manager For + * Agriculture resource. * * @return the publicNetworkAccess value. */ @@ -62,12 +64,13 @@ public PublicNetworkAccess publicNetworkAccess() { } /** - * Set the publicNetworkAccess property: Property to allow or block public traffic for an Azure FarmBeats resource. + * Set the publicNetworkAccess property: Property to allow or block public traffic for an Azure Data Manager For + * Agriculture resource. * * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the FarmBeatsUpdateProperties object itself. + * @return the DataManagerForAgricultureUpdateProperties object itself. */ - public FarmBeatsUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + public DataManagerForAgricultureUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { this.publicNetworkAccess = publicNetworkAccess; return this; } @@ -96,31 +99,33 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FarmBeatsUpdateProperties from the JsonReader. + * Reads an instance of DataManagerForAgricultureUpdateProperties from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsUpdateProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the FarmBeatsUpdateProperties. + * @return An instance of DataManagerForAgricultureUpdateProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureUpdateProperties. */ - public static FarmBeatsUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + public static DataManagerForAgricultureUpdateProperties fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FarmBeatsUpdateProperties deserializedFarmBeatsUpdateProperties = new FarmBeatsUpdateProperties(); + DataManagerForAgricultureUpdateProperties deserializedDataManagerForAgricultureUpdateProperties + = new DataManagerForAgricultureUpdateProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("sensorIntegration".equals(fieldName)) { - deserializedFarmBeatsUpdateProperties.sensorIntegration = SensorIntegration.fromJson(reader); + deserializedDataManagerForAgricultureUpdateProperties.sensorIntegration + = SensorIntegration.fromJson(reader); } else if ("publicNetworkAccess".equals(fieldName)) { - deserializedFarmBeatsUpdateProperties.publicNetworkAccess + deserializedDataManagerForAgricultureUpdateProperties.publicNetworkAccess = PublicNetworkAccess.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedFarmBeatsUpdateProperties; + return deserializedDataManagerForAgricultureUpdateProperties; }); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsUpdateRequestModel.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureUpdateRequestModel.java similarity index 59% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsUpdateRequestModel.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureUpdateRequestModel.java index 50976874e0eb..5cff83a5c9eb 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsUpdateRequestModel.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureUpdateRequestModel.java @@ -13,10 +13,11 @@ import java.util.Map; /** - * FarmBeats update request. + * DataManagerForAgriculture update request. */ @Fluent -public final class FarmBeatsUpdateRequestModel implements JsonSerializable { +public final class DataManagerForAgricultureUpdateRequestModel + implements JsonSerializable { /* * Geo-location where the resource lives. */ @@ -28,9 +29,9 @@ public final class FarmBeatsUpdateRequestModel implements JsonSerializable tags; /** - * Creates an instance of FarmBeatsUpdateRequestModel class. + * Creates an instance of DataManagerForAgricultureUpdateRequestModel class. */ - public FarmBeatsUpdateRequestModel() { + public DataManagerForAgricultureUpdateRequestModel() { } /** @@ -56,9 +57,9 @@ public String location() { * Set the location property: Geo-location where the resource lives. * * @param location the location value to set. - * @return the FarmBeatsUpdateRequestModel object itself. + * @return the DataManagerForAgricultureUpdateRequestModel object itself. */ - public FarmBeatsUpdateRequestModel withLocation(String location) { + public DataManagerForAgricultureUpdateRequestModel withLocation(String location) { this.location = location; return this; } @@ -76,29 +77,30 @@ public Identity identity() { * Set the identity property: Identity for the resource. * * @param identity the identity value to set. - * @return the FarmBeatsUpdateRequestModel object itself. + * @return the DataManagerForAgricultureUpdateRequestModel object itself. */ - public FarmBeatsUpdateRequestModel withIdentity(Identity identity) { + public DataManagerForAgricultureUpdateRequestModel withIdentity(Identity identity) { this.identity = identity; return this; } /** - * Get the properties property: FarmBeats ARM Resource properties. + * Get the properties property: Data Manager For Agriculture ARM Resource properties. * * @return the properties value. */ - public FarmBeatsUpdateProperties properties() { + public DataManagerForAgricultureUpdateProperties properties() { return this.properties; } /** - * Set the properties property: FarmBeats ARM Resource properties. + * Set the properties property: Data Manager For Agriculture ARM Resource properties. * * @param properties the properties value to set. - * @return the FarmBeatsUpdateRequestModel object itself. + * @return the DataManagerForAgricultureUpdateRequestModel object itself. */ - public FarmBeatsUpdateRequestModel withProperties(FarmBeatsUpdateProperties properties) { + public DataManagerForAgricultureUpdateRequestModel + withProperties(DataManagerForAgricultureUpdateProperties properties) { this.properties = properties; return this; } @@ -116,9 +118,9 @@ public Map tags() { * Set the tags property: Resource tags. * * @param tags the tags value to set. - * @return the FarmBeatsUpdateRequestModel object itself. + * @return the DataManagerForAgricultureUpdateRequestModel object itself. */ - public FarmBeatsUpdateRequestModel withTags(Map tags) { + public DataManagerForAgricultureUpdateRequestModel withTags(Map tags) { this.tags = tags; return this; } @@ -151,35 +153,37 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FarmBeatsUpdateRequestModel from the JsonReader. + * Reads an instance of DataManagerForAgricultureUpdateRequestModel from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsUpdateRequestModel if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the FarmBeatsUpdateRequestModel. + * @return An instance of DataManagerForAgricultureUpdateRequestModel if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataManagerForAgricultureUpdateRequestModel. */ - public static FarmBeatsUpdateRequestModel fromJson(JsonReader jsonReader) throws IOException { + public static DataManagerForAgricultureUpdateRequestModel fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FarmBeatsUpdateRequestModel deserializedFarmBeatsUpdateRequestModel = new FarmBeatsUpdateRequestModel(); + DataManagerForAgricultureUpdateRequestModel deserializedDataManagerForAgricultureUpdateRequestModel + = new DataManagerForAgricultureUpdateRequestModel(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("location".equals(fieldName)) { - deserializedFarmBeatsUpdateRequestModel.location = reader.getString(); + deserializedDataManagerForAgricultureUpdateRequestModel.location = reader.getString(); } else if ("identity".equals(fieldName)) { - deserializedFarmBeatsUpdateRequestModel.identity = Identity.fromJson(reader); + deserializedDataManagerForAgricultureUpdateRequestModel.identity = Identity.fromJson(reader); } else if ("properties".equals(fieldName)) { - deserializedFarmBeatsUpdateRequestModel.properties = FarmBeatsUpdateProperties.fromJson(reader); + deserializedDataManagerForAgricultureUpdateRequestModel.properties + = DataManagerForAgricultureUpdateProperties.fromJson(reader); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedFarmBeatsUpdateRequestModel.tags = tags; + deserializedDataManagerForAgricultureUpdateRequestModel.tags = tags; } else { reader.skipChildren(); } } - return deserializedFarmBeatsUpdateRequestModel; + return deserializedDataManagerForAgricultureUpdateRequestModel; }); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DetailedInformation.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DetailedInformation.java index f77f80401318..fe577d359836 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DetailedInformation.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DetailedInformation.java @@ -13,15 +13,25 @@ import java.util.List; /** - * Model to capture detailed information for farmBeatsExtensions. + * Model to capture detailed information for Data Manager For AgricultureExtensions. */ @Fluent public final class DetailedInformation implements JsonSerializable { /* - * ApiName available for the farmBeatsExtension. + * ApiName available for the Data Manager For Agriculture Extension. */ private String apiName; + /* + * Extension provider's API documentation link. + */ + private String apiDocsLink; + + /* + * Type of Api in Extension. + */ + private String apiType; + /* * List of customParameters. */ @@ -32,6 +42,11 @@ public final class DetailedInformation implements JsonSerializable platformParameters; + /* + * List of defaultParameters. + */ + private List apiDefaultInputParameters; + /* * Unit systems info for the data provider. */ @@ -49,7 +64,7 @@ public DetailedInformation() { } /** - * Get the apiName property: ApiName available for the farmBeatsExtension. + * Get the apiName property: ApiName available for the Data Manager For Agriculture Extension. * * @return the apiName value. */ @@ -58,7 +73,7 @@ public String apiName() { } /** - * Set the apiName property: ApiName available for the farmBeatsExtension. + * Set the apiName property: ApiName available for the Data Manager For Agriculture Extension. * * @param apiName the apiName value to set. * @return the DetailedInformation object itself. @@ -68,6 +83,46 @@ public DetailedInformation withApiName(String apiName) { return this; } + /** + * Get the apiDocsLink property: Extension provider's API documentation link. + * + * @return the apiDocsLink value. + */ + public String apiDocsLink() { + return this.apiDocsLink; + } + + /** + * Set the apiDocsLink property: Extension provider's API documentation link. + * + * @param apiDocsLink the apiDocsLink value to set. + * @return the DetailedInformation object itself. + */ + public DetailedInformation withApiDocsLink(String apiDocsLink) { + this.apiDocsLink = apiDocsLink; + return this; + } + + /** + * Get the apiType property: Type of Api in Extension. + * + * @return the apiType value. + */ + public String apiType() { + return this.apiType; + } + + /** + * Set the apiType property: Type of Api in Extension. + * + * @param apiType the apiType value to set. + * @return the DetailedInformation object itself. + */ + public DetailedInformation withApiType(String apiType) { + this.apiType = apiType; + return this; + } + /** * Get the customParameters property: List of customParameters. * @@ -108,6 +163,26 @@ public DetailedInformation withPlatformParameters(List platformParameter return this; } + /** + * Get the apiDefaultInputParameters property: List of defaultParameters. + * + * @return the apiDefaultInputParameters value. + */ + public List apiDefaultInputParameters() { + return this.apiDefaultInputParameters; + } + + /** + * Set the apiDefaultInputParameters property: List of defaultParameters. + * + * @param apiDefaultInputParameters the apiDefaultInputParameters value to set. + * @return the DetailedInformation object itself. + */ + public DetailedInformation withApiDefaultInputParameters(List apiDefaultInputParameters) { + this.apiDefaultInputParameters = apiDefaultInputParameters; + return this; + } + /** * Get the unitsSupported property: Unit systems info for the data provider. * @@ -166,10 +241,14 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("apiName", this.apiName); + jsonWriter.writeStringField("apiDocsLink", this.apiDocsLink); + jsonWriter.writeStringField("apiType", this.apiType); jsonWriter.writeArrayField("customParameters", this.customParameters, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("platformParameters", this.platformParameters, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("apiDefaultInputParameters", this.apiDefaultInputParameters, + (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("unitsSupported", this.unitsSupported); jsonWriter.writeArrayField("apiInputParameters", this.apiInputParameters, (writer, element) -> writer.writeString(element)); @@ -193,12 +272,19 @@ public static DetailedInformation fromJson(JsonReader jsonReader) throws IOExcep if ("apiName".equals(fieldName)) { deserializedDetailedInformation.apiName = reader.getString(); + } else if ("apiDocsLink".equals(fieldName)) { + deserializedDetailedInformation.apiDocsLink = reader.getString(); + } else if ("apiType".equals(fieldName)) { + deserializedDetailedInformation.apiType = reader.getString(); } else if ("customParameters".equals(fieldName)) { List customParameters = reader.readArray(reader1 -> reader1.getString()); deserializedDetailedInformation.customParameters = customParameters; } else if ("platformParameters".equals(fieldName)) { List platformParameters = reader.readArray(reader1 -> reader1.getString()); deserializedDetailedInformation.platformParameters = platformParameters; + } else if ("apiDefaultInputParameters".equals(fieldName)) { + List apiDefaultInputParameters = reader.readArray(reader1 -> reader1.getString()); + deserializedDetailedInformation.apiDefaultInputParameters = apiDefaultInputParameters; } else if ("unitsSupported".equals(fieldName)) { deserializedDetailedInformation.unitsSupported = UnitSystemsInfo.fromJson(reader); } else if ("apiInputParameters".equals(fieldName)) { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Extension.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Extension.java index 6972e103c80d..29ee8e5f6810 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Extension.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Extension.java @@ -84,7 +84,7 @@ public interface Extension { String extensionApiDocsLink(); /** - * Gets the additionalApiProperties property: Additional api properties. + * Gets the additionalApiProperties property: Additional Api Properties. * * @return the additionalApiProperties value. */ @@ -126,13 +126,13 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, farmBeatsResourceName. + * Specifies resourceGroupName, dataManagerForAgricultureResourceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @return the next definition stage. */ - WithCreate withExistingFarmBeat(String resourceGroupName, String farmBeatsResourceName); + WithCreate withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName); } /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ExtensionListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ExtensionListResponse.java index e2b49d93c9fb..98ee31f5bcf2 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ExtensionListResponse.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ExtensionListResponse.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.agrifood.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -23,6 +24,11 @@ public final class ExtensionListResponse implements JsonSerializable value; + /* + * Token used in retrieving the next page. If null, there are no additional pages. + */ + private String skipToken; + /* * Continuation link (absolute URI) to the next page of results in the list. */ @@ -54,6 +60,26 @@ public ExtensionListResponse withValue(List value) { return this; } + /** + * Get the skipToken property: Token used in retrieving the next page. If null, there are no additional pages. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: Token used in retrieving the next page. If null, there are no additional pages. + * + * @param skipToken the skipToken value to set. + * @return the ExtensionListResponse object itself. + */ + public ExtensionListResponse withSkipToken(String skipToken) { + this.skipToken = skipToken; + return this; + } + /** * Get the nextLink property: Continuation link (absolute URI) to the next page of results in the list. * @@ -69,11 +95,16 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ExtensionListResponse")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ExtensionListResponse.class); + /** * {@inheritDoc} */ @@ -81,6 +112,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("$skipToken", this.skipToken); return jsonWriter.writeEndObject(); } @@ -90,6 +122,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ExtensionListResponse if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ExtensionListResponse. */ public static ExtensionListResponse fromJson(JsonReader jsonReader) throws IOException { @@ -102,6 +135,8 @@ public static ExtensionListResponse fromJson(JsonReader jsonReader) throws IOExc if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> ExtensionInner.fromJson(reader1)); deserializedExtensionListResponse.value = value; + } else if ("$skipToken".equals(fieldName)) { + deserializedExtensionListResponse.skipToken = reader.getString(); } else if ("nextLink".equals(fieldName)) { deserializedExtensionListResponse.nextLink = reader.getString(); } else { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Extensions.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Extensions.java index b0f97c90dd81..4b4798cb90a6 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Extensions.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Extensions.java @@ -17,7 +17,7 @@ public interface Extensions { * Get installed extension details by extension id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -25,27 +25,27 @@ public interface Extensions { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return installed extension details by extension id along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, String extensionId, - Context context); + Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context); /** * Get installed extension details by extension id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return installed extension details by extension id. */ - Extension get(String resourceGroupName, String farmBeatsResourceName, String extensionId); + Extension get(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId); /** * Uninstall extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -53,38 +53,39 @@ Response getWithResponse(String resourceGroupName, String farmBeatsRe * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, String extensionId, - Context context); + Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context); /** * Uninstall extension. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionId Id of extension resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String farmBeatsResourceName, String extensionId); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId); /** * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 installed extensions details as paginated response with {@link PagedIterable}. */ - PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName); + PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName); /** * Get installed extensions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param extensionIds Installed extension ids. * @param extensionCategories Installed extension categories. * @param maxPageSize Maximum number of items needed (inclusive). @@ -96,9 +97,9 @@ Response deleteWithResponse(String resourceGroupName, String farmBeatsReso * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return installed extensions details as paginated response with {@link PagedIterable}. */ - PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName, - List extensionIds, List extensionCategories, Integer maxPageSize, String skipToken, - Context context); + PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken, Context context); /** * Get installed extension details by extension id. diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtension.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtension.java deleted file mode 100644 index a2c04f47e4c1..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtension.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner; -import java.util.List; - -/** - * An immutable client-side representation of FarmBeatsExtension. - */ -public interface FarmBeatsExtension { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the targetResourceType property: Target ResourceType of the farmBeatsExtension. - * - * @return the targetResourceType value. - */ - String targetResourceType(); - - /** - * Gets the farmBeatsExtensionId property: FarmBeatsExtension ID. - * - * @return the farmBeatsExtensionId value. - */ - String farmBeatsExtensionId(); - - /** - * Gets the farmBeatsExtensionName property: FarmBeatsExtension name. - * - * @return the farmBeatsExtensionName value. - */ - String farmBeatsExtensionName(); - - /** - * Gets the farmBeatsExtensionVersion property: FarmBeatsExtension version. - * - * @return the farmBeatsExtensionVersion value. - */ - String farmBeatsExtensionVersion(); - - /** - * Gets the publisherId property: Publisher ID. - * - * @return the publisherId value. - */ - String publisherId(); - - /** - * Gets the description property: Textual description. - * - * @return the description value. - */ - String description(); - - /** - * Gets the extensionCategory property: Category of the extension. e.g. weather/sensor/satellite. - * - * @return the extensionCategory value. - */ - String extensionCategory(); - - /** - * Gets the extensionAuthLink property: FarmBeatsExtension auth link. - * - * @return the extensionAuthLink value. - */ - String extensionAuthLink(); - - /** - * Gets the extensionApiDocsLink property: FarmBeatsExtension api docs link. - * - * @return the extensionApiDocsLink value. - */ - String extensionApiDocsLink(); - - /** - * Gets the detailedInformation property: Detailed information which shows summary of requested data. - * Used in descriptive get extension metadata call. - * Information for weather category per api included are apisSupported, - * customParameters, PlatformParameters and Units supported. - * - * @return the detailedInformation value. - */ - List detailedInformation(); - - /** - * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner object. - * - * @return the inner object. - */ - FarmBeatsExtensionInner innerModel(); -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsListResponse.java deleted file mode 100644 index 72c803dbb7f8..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsListResponse.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; -import java.io.IOException; -import java.util.List; - -/** - * Paged response contains list of requested objects and a URL link to get the next set of results. - */ -@Fluent -public final class FarmBeatsListResponse implements JsonSerializable { - /* - * List of requested objects. - */ - private List value; - - /* - * Continuation link (absolute URI) to the next page of results in the list. - */ - private String nextLink; - - /** - * Creates an instance of FarmBeatsListResponse class. - */ - public FarmBeatsListResponse() { - } - - /** - * Get the value property: List of requested objects. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of requested objects. - * - * @param value the value value to set. - * @return the FarmBeatsListResponse object itself. - */ - public FarmBeatsListResponse withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Continuation link (absolute URI) to the next page of results in the list. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FarmBeatsListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FarmBeatsListResponse if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the FarmBeatsListResponse. - */ - public static FarmBeatsListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FarmBeatsListResponse deserializedFarmBeatsListResponse = new FarmBeatsListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> FarmBeatsInner.fromJson(reader1)); - deserializedFarmBeatsListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedFarmBeatsListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFarmBeatsListResponse; - }); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsProperties.java deleted file mode 100644 index 4684c16619cb..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.models; - -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsPropertiesInner; - -/** - * An immutable client-side representation of FarmBeatsProperties. - */ -public interface FarmBeatsProperties { - /** - * Gets the instanceUri property: Uri of the FarmBeats instance. - * - * @return the instanceUri value. - */ - String instanceUri(); - - /** - * Gets the provisioningState property: FarmBeats instance provisioning state. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the sensorIntegration property: Sensor integration request model. - * - * @return the sensorIntegration value. - */ - SensorIntegration sensorIntegration(); - - /** - * Gets the publicNetworkAccess property: Property to allow or block public traffic for an Azure FarmBeats resource. - * - * @return the publicNetworkAccess value. - */ - PublicNetworkAccess publicNetworkAccess(); - - /** - * Gets the privateEndpointConnections property: The private endpoint connection resource. - * - * @return the privateEndpointConnections value. - */ - PrivateEndpointConnection privateEndpointConnections(); - - /** - * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsPropertiesInner object. - * - * @return the inner object. - */ - FarmBeatsPropertiesInner innerModel(); -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Insight.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Insight.java deleted file mode 100644 index 78f680a5dcaf..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Insight.java +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Map; - -/** - * The Insight model. - */ -@Fluent -public final class Insight implements JsonSerializable { - /* - * The farmerId property. - */ - private String farmerId; - - /* - * The modelId property. - */ - private String modelId; - - /* - * The resourceType property. - */ - private String resourceType; - - /* - * The resourceId property. - */ - private String resourceId; - - /* - * The modelVersion property. - */ - private String modelVersion; - - /* - * The insightStartDateTime property. - */ - private OffsetDateTime insightStartDateTime; - - /* - * The insightEndDateTime property. - */ - private OffsetDateTime insightEndDateTime; - - /* - * Dictionary of - */ - private Map measures; - - /* - * The id property. - */ - private String id; - - /* - * The status property. - */ - private String status; - - /* - * The createdDateTime property. - */ - private OffsetDateTime createdDateTime; - - /* - * The modifiedDateTime property. - */ - private OffsetDateTime modifiedDateTime; - - /* - * The eTag property. - */ - private String etag; - - /* - * The name property. - */ - private String name; - - /* - * The description property. - */ - private String description; - - /* - * Dictionary of - */ - private Map properties; - - /** - * Creates an instance of Insight class. - */ - public Insight() { - } - - /** - * Get the farmerId property: The farmerId property. - * - * @return the farmerId value. - */ - public String farmerId() { - return this.farmerId; - } - - /** - * Set the farmerId property: The farmerId property. - * - * @param farmerId the farmerId value to set. - * @return the Insight object itself. - */ - public Insight withFarmerId(String farmerId) { - this.farmerId = farmerId; - return this; - } - - /** - * Get the modelId property: The modelId property. - * - * @return the modelId value. - */ - public String modelId() { - return this.modelId; - } - - /** - * Set the modelId property: The modelId property. - * - * @param modelId the modelId value to set. - * @return the Insight object itself. - */ - public Insight withModelId(String modelId) { - this.modelId = modelId; - return this; - } - - /** - * Get the resourceType property: The resourceType property. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: The resourceType property. - * - * @param resourceType the resourceType value to set. - * @return the Insight object itself. - */ - public Insight withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the resourceId property: The resourceId property. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The resourceId property. - * - * @param resourceId the resourceId value to set. - * @return the Insight object itself. - */ - public Insight withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the modelVersion property: The modelVersion property. - * - * @return the modelVersion value. - */ - public String modelVersion() { - return this.modelVersion; - } - - /** - * Set the modelVersion property: The modelVersion property. - * - * @param modelVersion the modelVersion value to set. - * @return the Insight object itself. - */ - public Insight withModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - return this; - } - - /** - * Get the insightStartDateTime property: The insightStartDateTime property. - * - * @return the insightStartDateTime value. - */ - public OffsetDateTime insightStartDateTime() { - return this.insightStartDateTime; - } - - /** - * Set the insightStartDateTime property: The insightStartDateTime property. - * - * @param insightStartDateTime the insightStartDateTime value to set. - * @return the Insight object itself. - */ - public Insight withInsightStartDateTime(OffsetDateTime insightStartDateTime) { - this.insightStartDateTime = insightStartDateTime; - return this; - } - - /** - * Get the insightEndDateTime property: The insightEndDateTime property. - * - * @return the insightEndDateTime value. - */ - public OffsetDateTime insightEndDateTime() { - return this.insightEndDateTime; - } - - /** - * Set the insightEndDateTime property: The insightEndDateTime property. - * - * @param insightEndDateTime the insightEndDateTime value to set. - * @return the Insight object itself. - */ - public Insight withInsightEndDateTime(OffsetDateTime insightEndDateTime) { - this.insightEndDateTime = insightEndDateTime; - return this; - } - - /** - * Get the measures property: Dictionary of <Measure>. - * - * @return the measures value. - */ - public Map measures() { - return this.measures; - } - - /** - * Set the measures property: Dictionary of <Measure>. - * - * @param measures the measures value to set. - * @return the Insight object itself. - */ - public Insight withMeasures(Map measures) { - this.measures = measures; - return this; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the Insight object itself. - */ - public Insight withId(String id) { - this.id = id; - return this; - } - - /** - * Get the status property: The status property. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: The status property. - * - * @param status the status value to set. - * @return the Insight object itself. - */ - public Insight withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the createdDateTime property: The createdDateTime property. - * - * @return the createdDateTime value. - */ - public OffsetDateTime createdDateTime() { - return this.createdDateTime; - } - - /** - * Set the createdDateTime property: The createdDateTime property. - * - * @param createdDateTime the createdDateTime value to set. - * @return the Insight object itself. - */ - public Insight withCreatedDateTime(OffsetDateTime createdDateTime) { - this.createdDateTime = createdDateTime; - return this; - } - - /** - * Get the modifiedDateTime property: The modifiedDateTime property. - * - * @return the modifiedDateTime value. - */ - public OffsetDateTime modifiedDateTime() { - return this.modifiedDateTime; - } - - /** - * Set the modifiedDateTime property: The modifiedDateTime property. - * - * @param modifiedDateTime the modifiedDateTime value to set. - * @return the Insight object itself. - */ - public Insight withModifiedDateTime(OffsetDateTime modifiedDateTime) { - this.modifiedDateTime = modifiedDateTime; - return this; - } - - /** - * Get the etag property: The eTag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The eTag property. - * - * @param etag the etag value to set. - * @return the Insight object itself. - */ - public Insight withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name property. - * - * @param name the name value to set. - * @return the Insight object itself. - */ - public Insight withName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: The description property. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description property. - * - * @param description the description value to set. - * @return the Insight object itself. - */ - public Insight withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the properties property: Dictionary of <any>. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: Dictionary of <any>. - * - * @param properties the properties value to set. - * @return the Insight object itself. - */ - public Insight withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (measures() != null) { - measures().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("farmerId", this.farmerId); - jsonWriter.writeStringField("modelId", this.modelId); - jsonWriter.writeStringField("resourceType", this.resourceType); - jsonWriter.writeStringField("resourceId", this.resourceId); - jsonWriter.writeStringField("modelVersion", this.modelVersion); - jsonWriter.writeStringField("insightStartDateTime", - this.insightStartDateTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.insightStartDateTime)); - jsonWriter.writeStringField("insightEndDateTime", - this.insightEndDateTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.insightEndDateTime)); - jsonWriter.writeMapField("measures", this.measures, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeStringField("createdDateTime", - this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); - jsonWriter.writeStringField("modifiedDateTime", - this.modifiedDateTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.modifiedDateTime)); - jsonWriter.writeStringField("eTag", this.etag); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeUntyped(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Insight from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Insight if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. - * @throws IOException If an error occurs while reading the Insight. - */ - public static Insight fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Insight deserializedInsight = new Insight(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("farmerId".equals(fieldName)) { - deserializedInsight.farmerId = reader.getString(); - } else if ("modelId".equals(fieldName)) { - deserializedInsight.modelId = reader.getString(); - } else if ("resourceType".equals(fieldName)) { - deserializedInsight.resourceType = reader.getString(); - } else if ("resourceId".equals(fieldName)) { - deserializedInsight.resourceId = reader.getString(); - } else if ("modelVersion".equals(fieldName)) { - deserializedInsight.modelVersion = reader.getString(); - } else if ("insightStartDateTime".equals(fieldName)) { - deserializedInsight.insightStartDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("insightEndDateTime".equals(fieldName)) { - deserializedInsight.insightEndDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("measures".equals(fieldName)) { - Map measures = reader.readMap(reader1 -> Measure.fromJson(reader1)); - deserializedInsight.measures = measures; - } else if ("id".equals(fieldName)) { - deserializedInsight.id = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedInsight.status = reader.getString(); - } else if ("createdDateTime".equals(fieldName)) { - deserializedInsight.createdDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("modifiedDateTime".equals(fieldName)) { - deserializedInsight.modifiedDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("eTag".equals(fieldName)) { - deserializedInsight.etag = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedInsight.name = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedInsight.description = reader.getString(); - } else if ("properties".equals(fieldName)) { - Map properties = reader.readMap(reader1 -> reader1.readUntyped()); - deserializedInsight.properties = properties; - } else { - reader.skipChildren(); - } - } - - return deserializedInsight; - }); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/InsightAttachment.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/InsightAttachment.java deleted file mode 100644 index 5b1c97e22cb8..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/InsightAttachment.java +++ /dev/null @@ -1,466 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The InsightAttachment model. - */ -@Fluent -public final class InsightAttachment implements JsonSerializable { - /* - * The insightId property. - */ - private String insightId; - - /* - * The modelId property. - */ - private String modelId; - - /* - * The resourceType property. - */ - private String resourceType; - - /* - * The resourceId property. - */ - private String resourceId; - - /* - * The fileLink property. - */ - private String fileLink; - - /* - * The originalFileName property. - */ - private String originalFileName; - - /* - * The farmerId property. - */ - private String farmerId; - - /* - * The id property. - */ - private String id; - - /* - * The status property. - */ - private String status; - - /* - * The createdDateTime property. - */ - private OffsetDateTime createdDateTime; - - /* - * The modifiedDateTime property. - */ - private OffsetDateTime modifiedDateTime; - - /* - * The name property. - */ - private String name; - - /* - * The description property. - */ - private String description; - - /* - * The eTag property. - */ - private String etag; - - /** - * Creates an instance of InsightAttachment class. - */ - public InsightAttachment() { - } - - /** - * Get the insightId property: The insightId property. - * - * @return the insightId value. - */ - public String insightId() { - return this.insightId; - } - - /** - * Set the insightId property: The insightId property. - * - * @param insightId the insightId value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withInsightId(String insightId) { - this.insightId = insightId; - return this; - } - - /** - * Get the modelId property: The modelId property. - * - * @return the modelId value. - */ - public String modelId() { - return this.modelId; - } - - /** - * Set the modelId property: The modelId property. - * - * @param modelId the modelId value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withModelId(String modelId) { - this.modelId = modelId; - return this; - } - - /** - * Get the resourceType property: The resourceType property. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: The resourceType property. - * - * @param resourceType the resourceType value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the resourceId property: The resourceId property. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The resourceId property. - * - * @param resourceId the resourceId value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the fileLink property: The fileLink property. - * - * @return the fileLink value. - */ - public String fileLink() { - return this.fileLink; - } - - /** - * Set the fileLink property: The fileLink property. - * - * @param fileLink the fileLink value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withFileLink(String fileLink) { - this.fileLink = fileLink; - return this; - } - - /** - * Get the originalFileName property: The originalFileName property. - * - * @return the originalFileName value. - */ - public String originalFileName() { - return this.originalFileName; - } - - /** - * Set the originalFileName property: The originalFileName property. - * - * @param originalFileName the originalFileName value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withOriginalFileName(String originalFileName) { - this.originalFileName = originalFileName; - return this; - } - - /** - * Get the farmerId property: The farmerId property. - * - * @return the farmerId value. - */ - public String farmerId() { - return this.farmerId; - } - - /** - * Set the farmerId property: The farmerId property. - * - * @param farmerId the farmerId value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withFarmerId(String farmerId) { - this.farmerId = farmerId; - return this; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withId(String id) { - this.id = id; - return this; - } - - /** - * Get the status property: The status property. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: The status property. - * - * @param status the status value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the createdDateTime property: The createdDateTime property. - * - * @return the createdDateTime value. - */ - public OffsetDateTime createdDateTime() { - return this.createdDateTime; - } - - /** - * Set the createdDateTime property: The createdDateTime property. - * - * @param createdDateTime the createdDateTime value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withCreatedDateTime(OffsetDateTime createdDateTime) { - this.createdDateTime = createdDateTime; - return this; - } - - /** - * Get the modifiedDateTime property: The modifiedDateTime property. - * - * @return the modifiedDateTime value. - */ - public OffsetDateTime modifiedDateTime() { - return this.modifiedDateTime; - } - - /** - * Set the modifiedDateTime property: The modifiedDateTime property. - * - * @param modifiedDateTime the modifiedDateTime value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withModifiedDateTime(OffsetDateTime modifiedDateTime) { - this.modifiedDateTime = modifiedDateTime; - return this; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name property. - * - * @param name the name value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: The description property. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description property. - * - * @param description the description value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the etag property: The eTag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The eTag property. - * - * @param etag the etag value to set. - * @return the InsightAttachment object itself. - */ - public InsightAttachment withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("insightId", this.insightId); - jsonWriter.writeStringField("modelId", this.modelId); - jsonWriter.writeStringField("resourceType", this.resourceType); - jsonWriter.writeStringField("resourceId", this.resourceId); - jsonWriter.writeStringField("fileLink", this.fileLink); - jsonWriter.writeStringField("originalFileName", this.originalFileName); - jsonWriter.writeStringField("farmerId", this.farmerId); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeStringField("createdDateTime", - this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); - jsonWriter.writeStringField("modifiedDateTime", - this.modifiedDateTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.modifiedDateTime)); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InsightAttachment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InsightAttachment if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the InsightAttachment. - */ - public static InsightAttachment fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InsightAttachment deserializedInsightAttachment = new InsightAttachment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("insightId".equals(fieldName)) { - deserializedInsightAttachment.insightId = reader.getString(); - } else if ("modelId".equals(fieldName)) { - deserializedInsightAttachment.modelId = reader.getString(); - } else if ("resourceType".equals(fieldName)) { - deserializedInsightAttachment.resourceType = reader.getString(); - } else if ("resourceId".equals(fieldName)) { - deserializedInsightAttachment.resourceId = reader.getString(); - } else if ("fileLink".equals(fieldName)) { - deserializedInsightAttachment.fileLink = reader.getString(); - } else if ("originalFileName".equals(fieldName)) { - deserializedInsightAttachment.originalFileName = reader.getString(); - } else if ("farmerId".equals(fieldName)) { - deserializedInsightAttachment.farmerId = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedInsightAttachment.id = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedInsightAttachment.status = reader.getString(); - } else if ("createdDateTime".equals(fieldName)) { - deserializedInsightAttachment.createdDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("modifiedDateTime".equals(fieldName)) { - deserializedInsightAttachment.modifiedDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("name".equals(fieldName)) { - deserializedInsightAttachment.name = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedInsightAttachment.description = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedInsightAttachment.etag = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedInsightAttachment; - }); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/KeyVaultProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/KeyVaultProperties.java new file mode 100644 index 000000000000..2fb6c9cb20cf --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/KeyVaultProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the key vault. + */ +@Fluent +public final class KeyVaultProperties implements JsonSerializable { + /* + * Uri of the key vault. + */ + private String keyVaultUri; + + /* + * Name of Key Vault key. + */ + private String keyName; + + /* + * Version of Key Vault key. + */ + private String keyVersion; + + /** + * Creates an instance of KeyVaultProperties class. + */ + public KeyVaultProperties() { + } + + /** + * Get the keyVaultUri property: Uri of the key vault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: Uri of the key vault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the keyName property: Name of Key Vault key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: Name of Key Vault key. + * + * @param keyName the keyName value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: Version of Key Vault key. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: Version of Key Vault key. + * + * @param keyVersion the keyVersion value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultUri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyVaultUri in model KeyVaultProperties")); + } + if (keyName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyName in model KeyVaultProperties")); + } + if (keyVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyVersion in model KeyVaultProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyVaultUri", this.keyVaultUri); + jsonWriter.writeStringField("keyName", this.keyName); + jsonWriter.writeStringField("keyVersion", this.keyVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KeyVaultProperties. + */ + public static KeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultProperties deserializedKeyVaultProperties = new KeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultUri".equals(fieldName)) { + deserializedKeyVaultProperties.keyVaultUri = reader.getString(); + } else if ("keyName".equals(fieldName)) { + deserializedKeyVaultProperties.keyName = reader.getString(); + } else if ("keyVersion".equals(fieldName)) { + deserializedKeyVaultProperties.keyVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultProperties; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Measure.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Measure.java deleted file mode 100644 index 449ef8288263..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Measure.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Measure model. - */ -@Fluent -public final class Measure implements JsonSerializable { - /* - * The unit property. - */ - private String unit; - - /* - * The value property. - */ - private Double value; - - /** - * Creates an instance of Measure class. - */ - public Measure() { - } - - /** - * Get the unit property: The unit property. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: The unit property. - * - * @param unit the unit value to set. - * @return the Measure object itself. - */ - public Measure withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public Double value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the Measure object itself. - */ - public Measure withValue(Double value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("unit", this.unit); - jsonWriter.writeNumberField("value", this.value); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Measure from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Measure if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. - * @throws IOException If an error occurs while reading the Measure. - */ - public static Measure fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Measure deserializedMeasure = new Measure(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("unit".equals(fieldName)) { - deserializedMeasure.unit = reader.getString(); - } else if ("value".equals(fieldName)) { - deserializedMeasure.value = reader.getNullable(JsonReader::getDouble); - } else { - reader.skipChildren(); - } - } - - return deserializedMeasure; - }); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OAuthClientCredentials.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OAuthClientCredentials.java new file mode 100644 index 000000000000..0c5278e7dfb6 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OAuthClientCredentials.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * OAuthClientCredentials for clientId clientSecret auth. + */ +@Fluent +public final class OAuthClientCredentials extends AuthCredentials { + /* + * Enum for different types of AuthCredentials supported. + */ + private AuthCredentialsKind kind = AuthCredentialsKind.OAUTH_CLIENT_CREDENTIALS; + + /* + * ClientId associated with the provider. + */ + private String clientId; + + /* + * Properties of the key vault. + */ + private KeyVaultProperties clientSecret; + + /** + * Creates an instance of OAuthClientCredentials class. + */ + public OAuthClientCredentials() { + } + + /** + * Get the kind property: Enum for different types of AuthCredentials supported. + * + * @return the kind value. + */ + @Override + public AuthCredentialsKind kind() { + return this.kind; + } + + /** + * Get the clientId property: ClientId associated with the provider. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: ClientId associated with the provider. + * + * @param clientId the clientId value to set. + * @return the OAuthClientCredentials object itself. + */ + public OAuthClientCredentials withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Properties of the key vault. + * + * @return the clientSecret value. + */ + public KeyVaultProperties clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Properties of the key vault. + * + * @param clientSecret the clientSecret value to set. + * @return the OAuthClientCredentials object itself. + */ + public OAuthClientCredentials withClientSecret(KeyVaultProperties clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (clientId() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property clientId in model OAuthClientCredentials")); + } + if (clientSecret() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property clientSecret in model OAuthClientCredentials")); + } else { + clientSecret().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OAuthClientCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeJsonField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OAuthClientCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OAuthClientCredentials if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OAuthClientCredentials. + */ + public static OAuthClientCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OAuthClientCredentials deserializedOAuthClientCredentials = new OAuthClientCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedOAuthClientCredentials.clientId = reader.getString(); + } else if ("clientSecret".equals(fieldName)) { + deserializedOAuthClientCredentials.clientSecret = KeyVaultProperties.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedOAuthClientCredentials.kind = AuthCredentialsKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOAuthClientCredentials; + }); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationResults.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationResults.java index 10395e1d4835..78db8100a178 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationResults.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationResults.java @@ -12,27 +12,27 @@ */ public interface OperationResults { /** - * Get operationResults for a FarmBeats resource. + * Get operationResults for a Data Manager For Agriculture resource. * * @param locations Location. - * @param operationResultsId operation Results Id. + * @param operationResultsId operationResultsId for a specific location. * @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 operationResults for a FarmBeats resource along with {@link Response}. + * @return operationResults for a Data Manager For Agriculture resource along with {@link Response}. */ Response getWithResponse(String locations, String operationResultsId, Context context); /** - * Get operationResults for a FarmBeats resource. + * Get operationResults for a Data Manager For Agriculture resource. * * @param locations Location. - * @param operationResultsId operation Results Id. + * @param operationResultsId operationResultsId for a specific location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operationResults for a FarmBeats resource. + * @return operationResults for a Data Manager For Agriculture resource. */ ArmAsyncOperation get(String locations, String operationResultsId); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnection.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnection.java index 23d40ce7206f..619a83fe89ab 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnection.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnection.java @@ -106,13 +106,13 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, farmBeatsResourceName. + * Specifies resourceGroupName, dataManagerForAgricultureResourceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @return the next definition stage. */ - WithCreate withExistingFarmBeat(String resourceGroupName, String farmBeatsResourceName); + WithCreate withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName); } /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnectionListResult.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnectionListResult.java index 256241885a14..0d5d138c39d7 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnectionListResult.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnectionListResult.java @@ -4,99 +4,24 @@ package com.azure.resourcemanager.agrifood.models; -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; -import java.io.IOException; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionListResultInner; import java.util.List; /** - * List of private endpoint connections associated with the specified resource. + * An immutable client-side representation of PrivateEndpointConnectionListResult. */ -@Fluent -public final class PrivateEndpointConnectionListResult - implements JsonSerializable { - /* - * Array of private endpoint connections. - */ - private List value; - - /** - * Creates an instance of PrivateEndpointConnectionListResult class. - */ - public PrivateEndpointConnectionListResult() { - } - +public interface PrivateEndpointConnectionListResult { /** - * Get the value property: Array of private endpoint connections. + * Gets the value property: Array of private endpoint connections. * * @return the value value. */ - public List value() { - return this.value; - } - - /** - * Set the value property: Array of private endpoint connections. - * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResult object itself. - */ - public PrivateEndpointConnectionListResult withValue(List value) { - this.value = value; - return this; - } + List value(); /** - * Validates the instance. + * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionListResultInner object. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the inner object. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. - */ - public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult - = new PrivateEndpointConnectionListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); - deserializedPrivateEndpointConnectionListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionListResult; - }); - } + PrivateEndpointConnectionListResultInner innerModel(); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnections.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnections.java index 567ac02907d1..11cb99b39c31 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnections.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnections.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.agrifood.models; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -16,7 +15,7 @@ public interface PrivateEndpointConnections { * Get Private endpoint connection object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -26,14 +25,14 @@ public interface PrivateEndpointConnections { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection object along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, - String privateEndpointConnectionName, Context context); + Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context); /** * Get Private endpoint connection object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -42,60 +41,62 @@ Response getWithResponse(String resourceGroupName, St * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection object. */ - PrivateEndpointConnection get(String resourceGroupName, String farmBeatsResourceName, + PrivateEndpointConnection get(String resourceGroupName, String dataManagerForAgricultureResourceName, String privateEndpointConnectionName); /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection 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 farmBeatsResourceName, String privateEndpointConnectionName); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName); /** * Delete Private endpoint connection request. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param privateEndpointConnectionName Private endpoint connection 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. */ - void delete(String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, - Context context); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName, Context context); /** * Get list of Private endpoint connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private endpoint connections as paginated response with {@link PagedIterable}. + * @return list of Private endpoint connections along with {@link Response}. */ - PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName); + Response listByResourceWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context); /** * Get list of Private endpoint connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param context The context to associate with this operation. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private endpoint connections as paginated response with {@link PagedIterable}. + * @return list of Private endpoint connections. */ - PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName, - Context context); + PrivateEndpointConnectionListResult listByResource(String resourceGroupName, + String dataManagerForAgricultureResourceName); /** * Get Private endpoint connection object. diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResourceListResult.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResourceListResult.java index 5ae9987f6a2b..3d8a9af9a824 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResourceListResult.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResourceListResult.java @@ -4,98 +4,24 @@ package com.azure.resourcemanager.agrifood.models; -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner; -import java.io.IOException; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceListResultInner; import java.util.List; /** - * A list of private link resources. + * An immutable client-side representation of PrivateLinkResourceListResult. */ -@Fluent -public final class PrivateLinkResourceListResult implements JsonSerializable { - /* - * Array of private link resources - */ - private List value; - - /** - * Creates an instance of PrivateLinkResourceListResult class. - */ - public PrivateLinkResourceListResult() { - } - +public interface PrivateLinkResourceListResult { /** - * Get the value property: Array of private link resources. + * Gets the value property: Array of private link resources. * * @return the value value. */ - public List value() { - return this.value; - } - - /** - * Set the value property: Array of private link resources. - * - * @param value the value value to set. - * @return the PrivateLinkResourceListResult object itself. - */ - public PrivateLinkResourceListResult withValue(List value) { - this.value = value; - return this; - } + List value(); /** - * Validates the instance. + * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceListResultInner object. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the inner object. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkResourceListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResourceListResult if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PrivateLinkResourceListResult. - */ - public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult - = new PrivateLinkResourceListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); - deserializedPrivateLinkResourceListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResourceListResult; - }); - } + PrivateLinkResourceListResultInner innerModel(); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResources.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResources.java index 2f12f62e6710..6340642a5bb3 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResources.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResources.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.agrifood.models; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -16,33 +15,34 @@ public interface PrivateLinkResources { * Get list of Private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private link resources as paginated response with {@link PagedIterable}. + * @return list of Private link resources along with {@link Response}. */ - PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName); + Response listByResourceWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context); /** * Get list of Private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param context The context to associate with this operation. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 list of Private link resources as paginated response with {@link PagedIterable}. + * @return list of Private link resources. */ - PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName, - Context context); + PrivateLinkResourceListResult listByResource(String resourceGroupName, + String dataManagerForAgricultureResourceName); /** * Get Private link resource object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param subResourceName Sub resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -52,14 +52,14 @@ PagedIterable listByResource(String resourceGroupName, Stri * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private link resource object along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, - String subResourceName, Context context); + Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String subResourceName, Context context); /** * Get Private link resource object. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param subResourceName Sub resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -68,5 +68,6 @@ Response getWithResponse(String resourceGroupName, String f * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private link resource object. */ - PrivateLinkResource get(String resourceGroupName, String farmBeatsResourceName, String subResourceName); + PrivateLinkResource get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String subResourceName); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ProvisioningState.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ProvisioningState.java index fe842501da6f..8c9f3960fd15 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ProvisioningState.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ProvisioningState.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Sensor integration instance provisioning state. + * Data Manager For Agriculture instance provisioning state. */ public final class ProvisioningState extends ExpandableStringEnum { /** @@ -36,6 +36,11 @@ public final class ProvisioningState extends ExpandableStringEnum { /** @@ -17,9 +17,9 @@ public final class PublicNetworkAccess extends ExpandableStringEnum { - /* - * The resourceIdName property. - */ - private String resourceIdName; - - /* - * The resourceType property. - */ - private String resourceType; - - /** - * Creates an instance of ResourceParameter class. - */ - public ResourceParameter() { - } - - /** - * Get the resourceIdName property: The resourceIdName property. - * - * @return the resourceIdName value. - */ - public String resourceIdName() { - return this.resourceIdName; - } - - /** - * Set the resourceIdName property: The resourceIdName property. - * - * @param resourceIdName the resourceIdName value to set. - * @return the ResourceParameter object itself. - */ - public ResourceParameter withResourceIdName(String resourceIdName) { - this.resourceIdName = resourceIdName; - return this; - } - - /** - * Get the resourceType property: The resourceType property. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: The resourceType property. - * - * @param resourceType the resourceType value to set. - * @return the ResourceParameter object itself. - */ - public ResourceParameter withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceIdName", this.resourceIdName); - jsonWriter.writeStringField("resourceType", this.resourceType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceParameter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceParameter if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the ResourceParameter. - */ - public static ResourceParameter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceParameter deserializedResourceParameter = new ResourceParameter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceIdName".equals(fieldName)) { - deserializedResourceParameter.resourceIdName = reader.getString(); - } else if ("resourceType".equals(fieldName)) { - deserializedResourceParameter.resourceType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceParameter; - }); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SensorIntegration.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SensorIntegration.java index 24ae17192d61..f81bf6174f50 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SensorIntegration.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SensorIntegration.java @@ -18,7 +18,7 @@ @Fluent public final class SensorIntegration implements JsonSerializable { /* - * Sensor integration enable state. Allowed values are True, None + * Sensor integration enable state. */ private String enabled; @@ -40,7 +40,7 @@ public SensorIntegration() { } /** - * Get the enabled property: Sensor integration enable state. Allowed values are True, None. + * Get the enabled property: Sensor integration enable state. * * @return the enabled value. */ @@ -49,7 +49,7 @@ public String enabled() { } /** - * Set the enabled property: Sensor integration enable state. Allowed values are True, None. + * Set the enabled property: Sensor integration enable state. * * @param enabled the enabled value to set. * @return the SensorIntegration object itself. diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solution.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solution.java index 1b7446f63a78..d6b60bbdb3ea 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solution.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solution.java @@ -90,13 +90,13 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, farmBeatsResourceName. + * Specifies resourceGroupName, dataManagerForAgricultureResourceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @return the next definition stage. */ - WithCreate withExistingFarmBeat(String resourceGroupName, String farmBeatsResourceName); + WithCreate withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName); } /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionEvaluatedOutput.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionEvaluatedOutput.java deleted file mode 100644 index 1ddaa1011921..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionEvaluatedOutput.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The SolutionEvaluatedOutput model. - */ -@Fluent -public final class SolutionEvaluatedOutput implements JsonSerializable { - /* - * The insightResponse property. - */ - private Insight insightResponse; - - /* - * The insightAttachmentResponse property. - */ - private InsightAttachment insightAttachmentResponse; - - /** - * Creates an instance of SolutionEvaluatedOutput class. - */ - public SolutionEvaluatedOutput() { - } - - /** - * Get the insightResponse property: The insightResponse property. - * - * @return the insightResponse value. - */ - public Insight insightResponse() { - return this.insightResponse; - } - - /** - * Set the insightResponse property: The insightResponse property. - * - * @param insightResponse the insightResponse value to set. - * @return the SolutionEvaluatedOutput object itself. - */ - public SolutionEvaluatedOutput withInsightResponse(Insight insightResponse) { - this.insightResponse = insightResponse; - return this; - } - - /** - * Get the insightAttachmentResponse property: The insightAttachmentResponse property. - * - * @return the insightAttachmentResponse value. - */ - public InsightAttachment insightAttachmentResponse() { - return this.insightAttachmentResponse; - } - - /** - * Set the insightAttachmentResponse property: The insightAttachmentResponse property. - * - * @param insightAttachmentResponse the insightAttachmentResponse value to set. - * @return the SolutionEvaluatedOutput object itself. - */ - public SolutionEvaluatedOutput withInsightAttachmentResponse(InsightAttachment insightAttachmentResponse) { - this.insightAttachmentResponse = insightAttachmentResponse; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (insightResponse() != null) { - insightResponse().validate(); - } - if (insightAttachmentResponse() != null) { - insightAttachmentResponse().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("insightResponse", this.insightResponse); - jsonWriter.writeJsonField("insightAttachmentResponse", this.insightAttachmentResponse); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SolutionEvaluatedOutput from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SolutionEvaluatedOutput if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the SolutionEvaluatedOutput. - */ - public static SolutionEvaluatedOutput fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SolutionEvaluatedOutput deserializedSolutionEvaluatedOutput = new SolutionEvaluatedOutput(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("insightResponse".equals(fieldName)) { - deserializedSolutionEvaluatedOutput.insightResponse = Insight.fromJson(reader); - } else if ("insightAttachmentResponse".equals(fieldName)) { - deserializedSolutionEvaluatedOutput.insightAttachmentResponse = InsightAttachment.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSolutionEvaluatedOutput; - }); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionInstallationRequest.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionInstallationRequest.java deleted file mode 100644 index 973c63145bf6..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionInstallationRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Solution Installation Request Body. - */ -@Fluent -public final class SolutionInstallationRequest implements JsonSerializable { - /* - * Solution resource properties. - */ - private SolutionProperties properties; - - /** - * Creates an instance of SolutionInstallationRequest class. - */ - public SolutionInstallationRequest() { - } - - /** - * Get the properties property: Solution resource properties. - * - * @return the properties value. - */ - public SolutionProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Solution resource properties. - * - * @param properties the properties value to set. - * @return the SolutionInstallationRequest object itself. - */ - public SolutionInstallationRequest withProperties(SolutionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SolutionInstallationRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SolutionInstallationRequest if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SolutionInstallationRequest. - */ - public static SolutionInstallationRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SolutionInstallationRequest deserializedSolutionInstallationRequest = new SolutionInstallationRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedSolutionInstallationRequest.properties = SolutionProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSolutionInstallationRequest; - }); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionListResponse.java index 6f8d40f5307b..d53ea74bec22 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionListResponse.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionListResponse.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.agrifood.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -105,11 +106,16 @@ public SolutionListResponse withNextLink(String nextLink) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SolutionListResponse")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(SolutionListResponse.class); + /** * {@inheritDoc} */ @@ -128,6 +134,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of SolutionListResponse if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the SolutionListResponse. */ public static SolutionListResponse fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionProperties.java index 5ecb1a5681fe..b3f8233aaebd 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionProperties.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionProperties.java @@ -19,11 +19,6 @@ */ @Fluent public final class SolutionProperties implements JsonSerializable { - /* - * Solution Id. - */ - private String solutionId; - /* * Partner Id of the Solution. */ @@ -40,7 +35,7 @@ public final class SolutionProperties implements JsonSerializable additionalProperty : additionalProperties.entrySet()) { jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); @@ -314,10 +326,10 @@ public static SolutionProperties fromJson(JsonReader jsonReader) throws IOExcept deserializedSolutionProperties.offerId = reader.getString(); } else if ("termId".equals(fieldName)) { deserializedSolutionProperties.termId = reader.getString(); - } else if ("solutionId".equals(fieldName)) { - deserializedSolutionProperties.solutionId = reader.getString(); } else if ("partnerId".equals(fieldName)) { deserializedSolutionProperties.partnerId = reader.getString(); + } else if ("roleAssignmentId".equals(fieldName)) { + deserializedSolutionProperties.roleAssignmentId = reader.getString(); } else { if (additionalProperties == null) { additionalProperties = new LinkedHashMap<>(); diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solutions.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solutions.java index 7726df05e864..57fcb00e85fa 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solutions.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solutions.java @@ -18,74 +18,74 @@ public interface Solutions { * Get installed Solution details by Solution id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return installed Solution details by Solution id along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String farmBeatsResourceName, String solutionId, - Context context); + Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId, Context context); /** * Get installed Solution details by Solution id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return installed Solution details by Solution id. */ - Solution get(String resourceGroupName, String farmBeatsResourceName, String solutionId); + Solution get(String resourceGroupName, String dataManagerForAgricultureResourceName, String solutionId); /** * Uninstall Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, String solutionId, - Context context); + Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String solutionId, Context context); /** * Uninstall Solution. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param solutionId Solution Id of the solution. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionId SolutionId for Data Manager For Agriculture Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String farmBeatsResourceName, String solutionId); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String solutionId); /** * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource 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 installed Solutions details as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String farmBeatsResourceName); + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName); /** * Get installed Solutions details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. * @param solutionIds Installed Solution ids. * @param ids Ids of the resource. * @param names Names of the resource. @@ -105,10 +105,11 @@ Response deleteWithResponse(String resourceGroupName, String farmBeatsReso * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return installed Solutions details as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String farmBeatsResourceName, List solutionIds, - List ids, List names, List propertyFilters, List statuses, - OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, OffsetDateTime minLastModifiedDateTime, - OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, String skipToken, Context context); + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName, + List solutionIds, List ids, List names, List propertyFilters, + List statuses, OffsetDateTime minCreatedDateTime, OffsetDateTime maxCreatedDateTime, + OffsetDateTime minLastModifiedDateTime, OffsetDateTime maxLastModifiedDateTime, Integer maxPageSize, + String skipToken, Context context); /** * Get installed Solution details by Solution id. diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionsDiscoverabilities.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionsDiscoverabilities.java index f9ce108960c2..461cf6c6a4b4 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionsDiscoverabilities.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionsDiscoverabilities.java @@ -14,50 +14,52 @@ */ public interface SolutionsDiscoverabilities { /** - * Get list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Get list of farmBeats solutions. + * Get list of Data Manager For Agriculture solutions. * - * @param farmBeatsSolutionIds Ids of FarmBeats Solutions which the customer requests to fetch. - * @param farmBeatsSolutionNames Names of FarmBeats Solutions which the customer requests to fetch. + * @param farmBeatsSolutionIds Ids of Data Manager For Agriculture Solutions which the customer requests to fetch. + * @param farmBeatsSolutionNames Names of Data Manager For Agriculture Solutions which the customer requests to + * fetch. * @param maxPageSize Maximum number of items needed (inclusive). * Minimum = 10, Maximum = 1000, Default value = 50. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of farmBeats solutions as paginated response with {@link PagedIterable}. + * @return list of Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. */ - PagedIterable list(List farmBeatsSolutionIds, List farmBeatsSolutionNames, - Integer maxPageSize, Context context); + PagedIterable list(List farmBeatsSolutionIds, + List farmBeatsSolutionNames, Integer maxPageSize, Context context); /** - * Get farmBeats solution by id. + * Get Data Manager For Agriculture solution by id. * - * @param farmBeatsSolutionId farmBeatsSolutionId to be queried. + * @param dataManagerForAgricultureSolutionId dataManagerForAgricultureSolutionId to be queried. * @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 farmBeats solution by id along with {@link Response}. + * @return data Manager For Agriculture solution by id along with {@link Response}. */ - Response getWithResponse(String farmBeatsSolutionId, Context context); + Response getWithResponse(String dataManagerForAgricultureSolutionId, + Context context); /** - * Get farmBeats solution by id. + * Get Data Manager For Agriculture solution by id. * - * @param farmBeatsSolutionId farmBeatsSolutionId to be queried. + * @param dataManagerForAgricultureSolutionId dataManagerForAgricultureSolutionId to be queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return farmBeats solution by id. + * @return data Manager For Agriculture solution by id. */ - FarmBeatsSolution get(String farmBeatsSolutionId); + DataManagerForAgricultureSolution get(String dataManagerForAgricultureSolutionId); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/package-info.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/package-info.java index 9d1900d55d63..c65f90f7c323 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/package-info.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the data models for AgriFoodManagementClient. - * APIs documentation for Azure AgFoodPlatform Resource Provider Service. + * APIs documentation for Microsoft Azure Data Manager for Agriculture Service. */ package com.azure.resourcemanager.agrifood.models; diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/package-info.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/package-info.java index 89b417ff7c1e..4aa1767f0d4e 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/package-info.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/package-info.java @@ -4,6 +4,6 @@ /** * Package containing the classes for AgriFoodManagementClient. - * APIs documentation for Azure AgFoodPlatform Resource Provider Service. + * APIs documentation for Microsoft Azure Data Manager for Agriculture Service. */ package com.azure.resourcemanager.agrifood; diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/proxy-config.json b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/proxy-config.json index e1895019f2b9..4bebc5856d2d 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/proxy-config.json +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.agrifood.implementation.ExtensionsClientImpl$ExtensionsService"],["com.azure.resourcemanager.agrifood.implementation.FarmBeatsExtensionsClientImpl$FarmBeatsExtensionsService"],["com.azure.resourcemanager.agrifood.implementation.FarmBeatsModelsClientImpl$FarmBeatsModelsService"],["com.azure.resourcemanager.agrifood.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.agrifood.implementation.OperationResultsClientImpl$OperationResultsService"],["com.azure.resourcemanager.agrifood.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.agrifood.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.agrifood.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.agrifood.implementation.SolutionsClientImpl$SolutionsService"],["com.azure.resourcemanager.agrifood.implementation.SolutionsDiscoverabilitiesClientImpl$SolutionsDiscoverabilitiesService"]] \ No newline at end of file +[["com.azure.resourcemanager.agrifood.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService"],["com.azure.resourcemanager.agrifood.implementation.DataConnectorsClientImpl$DataConnectorsService"],["com.azure.resourcemanager.agrifood.implementation.DataManagerForAgricultureExtensionsClientImpl$DataManagerForAgricultureExtensionsService"],["com.azure.resourcemanager.agrifood.implementation.DataManagerForAgricultureResourcesClientImpl$DataManagerForAgricultureResourcesService"],["com.azure.resourcemanager.agrifood.implementation.ExtensionsClientImpl$ExtensionsService"],["com.azure.resourcemanager.agrifood.implementation.OperationResultsClientImpl$OperationResultsService"],["com.azure.resourcemanager.agrifood.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.agrifood.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.agrifood.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.agrifood.implementation.SolutionsClientImpl$SolutionsService"],["com.azure.resourcemanager.agrifood.implementation.SolutionsDiscoverabilitiesClientImpl$SolutionsDiscoverabilitiesService"]] \ No newline at end of file diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/azure-resourcemanager-agrifood.properties b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/azure-resourcemanager-agrifood.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/azure-resourcemanager-agrifood.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/LocationsCheckNameAvailabilitySamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityCheckNameAvailabilitySamples.java similarity index 55% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/LocationsCheckNameAvailabilitySamples.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityCheckNameAvailabilitySamples.java index 96be730136e0..d06404a6ef09 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/LocationsCheckNameAvailabilitySamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityCheckNameAvailabilitySamples.java @@ -7,40 +7,40 @@ import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; /** - * Samples for Locations CheckNameAvailability. + * Samples for CheckNameAvailability CheckNameAvailability. */ -public final class LocationsCheckNameAvailabilitySamples { +public final class CheckNameAvailabilityCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * Locations_CheckNameAvailability_Available.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * CheckNameAvailability_CheckNameAvailability_AlreadyExists.json */ /** - * Sample code: Locations_CheckNameAvailability_Available. + * Sample code: CheckNameAvailability_CheckNameAvailability_AlreadyExists. * * @param manager Entry point to AgriFoodManager. */ - public static void - locationsCheckNameAvailabilityAvailable(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.locations() - .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("newaccountname") + public static void checkNameAvailabilityCheckNameAvailabilityAlreadyExists( + com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.checkNameAvailabilities() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("existingaccountname") .withType("Microsoft.AgFoodPlatform/farmBeats"), com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * Locations_CheckNameAvailability_AlreadyExists.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * CheckNameAvailability_CheckNameAvailability_Available.json */ /** - * Sample code: Locations_CheckNameAvailability_AlreadyExists. + * Sample code: CheckNameAvailability_CheckNameAvailability_Available. * * @param manager Entry point to AgriFoodManager. */ - public static void - locationsCheckNameAvailabilityAlreadyExists(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.locations() - .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("existingaccountname") + public static void checkNameAvailabilityCheckNameAvailabilityAvailable( + com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.checkNameAvailabilities() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("newaccountname") .withType("Microsoft.AgFoodPlatform/farmBeats"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsCreateOrUpdateSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3f3f541f5b47 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +import com.azure.resourcemanager.agrifood.models.ApiKeyAuthCredentials; +import com.azure.resourcemanager.agrifood.models.DataConnectorProperties; +import com.azure.resourcemanager.agrifood.models.KeyVaultProperties; + +/** + * Samples for DataConnectors CreateOrUpdate. + */ +public final class DataConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataConnectors_CreateOrUpdate.json + */ + /** + * Sample code: DataConnectors_CreateOrUpdate. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void dataConnectorsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataConnectors() + .define("WeatherIBM") + .withExistingFarmBeat("examples-rg", "examples-dataManagerForAgricultureResourceName") + .withProperties(new DataConnectorProperties().withCredentials( + new ApiKeyAuthCredentials().withApiKey(new KeyVaultProperties().withKeyVaultUri("fakeTokenPlaceholder") + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder")))) + .create(); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsDeleteSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsDeleteSamples.java new file mode 100644 index 000000000000..fc1db7b52cad --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataConnectors Delete. + */ +public final class DataConnectorsDeleteSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataConnectors_Delete.json + */ + /** + * Sample code: DataConnectors_Delete. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void dataConnectorsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataConnectors() + .deleteWithResponse("examples-rg", "examples-dataManagerForAgricultureResourceName", "SatelliteSentinelHub", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsDeleteSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsGetSamples.java similarity index 50% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsDeleteSamples.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsGetSamples.java index 49c0eba01e44..aad3503b654e 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsDeleteSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsGetSamples.java @@ -5,22 +5,22 @@ package com.azure.resourcemanager.agrifood.generated; /** - * Samples for FarmBeatsModels Delete. + * Samples for DataConnectors Get. */ -public final class FarmBeatsModelsDeleteSamples { +public final class DataConnectorsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_Delete.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataConnectors_Get.json */ /** - * Sample code: FarmBeatsModels_Delete. + * Sample code: DataConnectors_Get. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels() - .deleteByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", + public static void dataConnectorsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataConnectors() + .getWithResponse("examples-rg", "examples-dataManagerForAgricultureResourceName", "SatelliteSentinelHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsGetByResourceGroupSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsListSamples.java similarity index 54% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsGetByResourceGroupSamples.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsListSamples.java index 61c62f69fc35..bf11a4e70712 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsGetByResourceGroupSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsListSamples.java @@ -5,22 +5,22 @@ package com.azure.resourcemanager.agrifood.generated; /** - * Samples for FarmBeatsModels GetByResourceGroup. + * Samples for DataConnectors List. */ -public final class FarmBeatsModelsGetByResourceGroupSamples { +public final class DataConnectorsListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_Get.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataConnectors_List.json */ /** - * Sample code: FarmBeatsModels_Get. + * Sample code: DataConnectors_List. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels() - .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", + public static void dataConnectorsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataConnectors() + .list("examples-rg", "examples-dataManagerForAgricultureResourceName", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsGetSamples.java new file mode 100644 index 000000000000..b3491aa59ba5 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureExtensions Get. + */ +public final class DataManagerForAgricultureExtensionsGetSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureExtensions_Get.json + */ + /** + * Sample code: DataManagerForAgricultureExtensions_Get. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void + dataManagerForAgricultureExtensionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureExtensions() + .getWithResponse("DTN.ContentServices", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsListSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsListSamples.java new file mode 100644 index 000000000000..6e90495df27d --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureExtensions List. + */ +public final class DataManagerForAgricultureExtensionsListSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureExtensions_List.json + */ + /** + * Sample code: DataManagerForAgricultureExtensions_List. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void + dataManagerForAgricultureExtensionsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureExtensions() + .list(null, null, null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsCreateOrUpdateSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesCreateOrUpdateSamples.java similarity index 68% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsCreateOrUpdateSamples.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesCreateOrUpdateSamples.java index 6f44a84f5250..803e88d838f2 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsCreateOrUpdateSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesCreateOrUpdateSamples.java @@ -8,21 +8,22 @@ import java.util.Map; /** - * Samples for FarmBeatsModels CreateOrUpdate. + * Samples for DataManagerForAgricultureResources CreateOrUpdate. */ -public final class FarmBeatsModelsCreateOrUpdateSamples { +public final class DataManagerForAgricultureResourcesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_CreateOrUpdate.json + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_CreateOrUpdate.json */ /** - * Sample code: FarmBeatsModels_CreateOrUpdate. + * Sample code: DataManagerForAgricultureResources_CreateOrUpdate. * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels() + public static void + dataManagerForAgricultureResourcesCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources() .define("examples-farmbeatsResourceName") .withRegion("eastus2") .withExistingResourceGroup("examples-rg") diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesDeleteSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesDeleteSamples.java new file mode 100644 index 000000000000..f09f0ca48c73 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureResources Delete. + */ +public final class DataManagerForAgricultureResourcesDeleteSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_Delete.json + */ + /** + * Sample code: DataManagerForAgricultureResources_Delete. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void + dataManagerForAgricultureResourcesDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources() + .deleteByResourceGroupWithResponse("examples-rg", "examples-dataManagerForAgricultureResourceName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesGetByResourceGroupSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..2ad4ae063bd6 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureResources GetByResourceGroup. + */ +public final class DataManagerForAgricultureResourcesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_Get.json + */ + /** + * Sample code: DataManagerForAgricultureResources_Get. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void + dataManagerForAgricultureResourcesGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources() + .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListByResourceGroupSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListByResourceGroupSamples.java new file mode 100644 index 000000000000..fadd791d9ce5 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureResources ListByResourceGroup. + */ +public final class DataManagerForAgricultureResourcesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_ListByResourceGroup.json + */ + /** + * Sample code: DataManagerForAgricultureResources_ListByResourceGroup. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void dataManagerForAgricultureResourcesListByResourceGroup( + com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources() + .listByResourceGroup("examples-rg", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListSamples.java new file mode 100644 index 000000000000..92c0665818c7 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureResources List. + */ +public final class DataManagerForAgricultureResourcesListSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_ListBySubscription.json + */ + /** + * Sample code: DataManagerForAgricultureResources_ListBySubscription. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void dataManagerForAgricultureResourcesListBySubscription( + com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources().list(null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesUpdateSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesUpdateSamples.java new file mode 100644 index 000000000000..c4b01bfdcbfd --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +import com.azure.resourcemanager.agrifood.models.DataManagerForAgriculture; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DataManagerForAgricultureResources Update. + */ +public final class DataManagerForAgricultureResourcesUpdateSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * DataManagerForAgricultureResources_Update.json + */ + /** + * Sample code: DataManagerForAgricultureResources_Update. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void + dataManagerForAgricultureResourcesUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + DataManagerForAgriculture resource = manager.dataManagerForAgricultureResources() + .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateOrUpdateSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateOrUpdateSamples.java index 51f1d12a995f..ef23fb372cd8 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateOrUpdateSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateOrUpdateSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Extensions_CreateOrUpdate.json */ /** @@ -21,7 +21,7 @@ public final class ExtensionsCreateOrUpdateSamples { public static void extensionsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { manager.extensions() .define("provider.extension") - .withExistingFarmBeat("examples-rg", "examples-farmbeatsResourceName") + .withExistingFarmBeat("examples-rg", "examples-dataManagerForAgricultureResourceName") .create(); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsDeleteSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsDeleteSamples.java index 963976deb241..03fc03fb8230 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsDeleteSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsDeleteSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Extensions_Delete.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsGetSamples.java index 5cd1e5a7d319..4b20c696184f 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsGetSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsGetSamples.java @@ -10,7 +10,7 @@ public final class ExtensionsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Extensions_Get.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByDataManagerForAgricultureSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByDataManagerForAgricultureSamples.java new file mode 100644 index 000000000000..6be19d5e13fd --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByDataManagerForAgricultureSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for Extensions ListByDataManagerForAgriculture. + */ +public final class ExtensionsListByDataManagerForAgricultureSamples { + /* + * x-ms-original-file: + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ + * Extensions_ListByDataManagerForAgriculture.json + */ + /** + * Sample code: Extensions_ListByDataManagerForAgriculture. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void + extensionsListByDataManagerForAgriculture(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.extensions() + .listByDataManagerForAgriculture("examples-rg", "examples-farmbeatsResourceName", null, null, null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsSamples.java deleted file mode 100644 index 54f4c6591059..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -/** - * Samples for Extensions ListByFarmBeats. - */ -public final class ExtensionsListByFarmBeatsSamples { - /* - * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * Extensions_ListByFarmBeats.json - */ - /** - * Sample code: Extensions_ListByFarmBeats. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void extensionsListByFarmBeats(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.extensions() - .listByFarmBeats("examples-rg", "examples-farmbeatsResourceName", null, null, null, null, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsGetSamples.java deleted file mode 100644 index 738f88310f80..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -/** - * Samples for FarmBeatsExtensions Get. - */ -public final class FarmBeatsExtensionsGetSamples { - /* - * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsExtensions_Get.json - */ - /** - * Sample code: FarmBeatsExtensions_Get. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsExtensionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsExtensions().getWithResponse("DTN.ContentServices", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsListSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsListSamples.java deleted file mode 100644 index 4d729b8806c7..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsListSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -/** - * Samples for FarmBeatsExtensions List. - */ -public final class FarmBeatsExtensionsListSamples { - /* - * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsExtensions_List.json - */ - /** - * Sample code: FarmBeatsExtensions_List. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsExtensionsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsExtensions().list(null, null, null, null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListByResourceGroupSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListByResourceGroupSamples.java deleted file mode 100644 index 6e6ce15546af..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListByResourceGroupSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -/** - * Samples for FarmBeatsModels ListByResourceGroup. - */ -public final class FarmBeatsModelsListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_ListByResourceGroup.json - */ - /** - * Sample code: FarmBeatsModels_ListByResourceGroup. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsModelsListByResourceGroup(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels().listByResourceGroup("examples-rg", null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListSamples.java deleted file mode 100644 index 9555af4c6cab..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -/** - * Samples for FarmBeatsModels List. - */ -public final class FarmBeatsModelsListSamples { - /* - * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_ListBySubscription.json - */ - /** - * Sample code: FarmBeatsModels_ListBySubscription. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsModelsListBySubscription(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels().list(null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsUpdateSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsUpdateSamples.java deleted file mode 100644 index 20547b227f8f..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsUpdateSamples.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.resourcemanager.agrifood.models.FarmBeats; -import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateProperties; -import com.azure.resourcemanager.agrifood.models.Identity; -import com.azure.resourcemanager.agrifood.models.ResourceIdentityType; -import com.azure.resourcemanager.agrifood.models.SensorIntegration; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for FarmBeatsModels Update. - */ -public final class FarmBeatsModelsUpdateSamples { - /* - * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_Update.json - */ - /** - * Sample code: FarmBeatsModels_Update. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsModelsUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - FarmBeats resource = manager.farmBeatsModels() - .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); - } - - /* - * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ - * FarmBeatsModels_UpdateWithSensor.json - */ - /** - * Sample code: FarmBeatsModels_UpdateWithSensor. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsModelsUpdateWithSensor(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - FarmBeats resource = manager.farmBeatsModels() - .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties( - new FarmBeatsUpdateProperties().withSensorIntegration(new SensorIntegration().withEnabled("True"))) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationResultsGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationResultsGetSamples.java index acfa46924466..25eaa3dfca25 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationResultsGetSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationResultsGetSamples.java @@ -10,7 +10,7 @@ public final class OperationResultsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * OperationResults_Get.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationsListSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationsListSamples.java index c69f0baefa1c..d290ac27c66c 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationsListSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Operations_List.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index 7eec8f08013d..5d0e521820e8 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateEndpointConnections_CreateOrUpdate.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteSamples.java index 1113932353a0..7790fadf8e9d 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateEndpointConnections_Delete.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsGetSamples.java index 1ec078e35c62..cede1977271b 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateEndpointConnections_Get.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceSamples.java index 69a54d7606ad..f28590d6a4ec 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsListByResourceSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateEndpointConnections_ListByResource.json */ /** @@ -21,6 +21,7 @@ public final class PrivateEndpointConnectionsListByResourceSamples { public static void privateEndpointConnectionsListByResource(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { manager.privateEndpointConnections() - .listByResource("examples-rg", "examples-farmbeatsResourceName", com.azure.core.util.Context.NONE); + .listByResourceWithResponse("examples-rg", "examples-farmbeatsResourceName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesGetSamples.java index cf4ff685ea88..fd7e27040568 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesGetSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateLinkResources_Get.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceSamples.java index 391bf584f8f8..09d5541c429c 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesListByResourceSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * PrivateLinkResources_ListByResource.json */ /** @@ -20,6 +20,7 @@ public final class PrivateLinkResourcesListByResourceSamples { */ public static void privateLinkResourcesListByResource(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { manager.privateLinkResources() - .listByResource("examples-rg", "examples-farmbeatsResourceName", com.azure.core.util.Context.NONE); + .listByResourceWithResponse("examples-rg", "examples-farmbeatsResourceName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsCreateOrUpdateSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsCreateOrUpdateSamples.java index 3715a9ffa76e..a432a36b7e91 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsCreateOrUpdateSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsCreateOrUpdateSamples.java @@ -4,17 +4,13 @@ package com.azure.resourcemanager.agrifood.generated; -import com.azure.resourcemanager.agrifood.models.SolutionProperties; -import java.util.HashMap; -import java.util.Map; - /** * Samples for Solutions CreateOrUpdate. */ public final class SolutionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Solutions_CreateOrUpdate.json */ /** @@ -26,25 +22,6 @@ public static void solutionsCreateOrUpdate(com.azure.resourcemanager.agrifood.Ag manager.solutions() .define("abc.partner") .withExistingFarmBeat("examples-rg", "examples-farmbeatsResourceName") - .withProperties(new SolutionProperties().withSaasSubscriptionId("123") - .withSaasSubscriptionName("name") - .withMarketplacePublisherId("publisherId") - .withPlanId("planId") - .withOfferId("offerId") - .withTermId("termId") - .withAdditionalProperties(mapOf())) .create(); } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDeleteSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDeleteSamples.java index 18921a8abc37..384bfdd7387c 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDeleteSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class SolutionsDeleteSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Solutions_Delete.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityGetSamples.java index bf7df6d8b4f0..a80dcc361b57 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityGetSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityGetSamples.java @@ -10,7 +10,7 @@ public final class SolutionsDiscoverabilityGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * SolutionsDiscoverability_Get.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityListSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityListSamples.java index 52fe829f6c4c..1fda149f1d0c 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityListSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityListSamples.java @@ -10,7 +10,7 @@ public final class SolutionsDiscoverabilityListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * SolutionsDiscoverability_List.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetSamples.java index f1234b74cde5..95ca88771e08 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetSamples.java @@ -10,7 +10,7 @@ public final class SolutionsGetSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Solutions_Get.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsListSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsListSamples.java index 41c7b95890db..1d86ffeb8170 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsListSamples.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsListSamples.java @@ -10,7 +10,7 @@ public final class SolutionsListSamples { /* * x-ms-original-file: - * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/ + * specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2024-12-01-preview/examples/ * Solutions_List.json */ /** diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ApiPropertiesTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ApiPropertiesTests.java deleted file mode 100644 index 5cb7a58a2568..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ApiPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.ApiProperties; -import org.junit.jupiter.api.Assertions; - -public final class ApiPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiProperties model - = BinaryData.fromString("{\"apiFreshnessTimeInMinutes\":501010271}").toObject(ApiProperties.class); - Assertions.assertEquals(501010271, model.apiFreshnessTimeInMinutes()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiProperties model = new ApiProperties().withApiFreshnessTimeInMinutes(501010271); - model = BinaryData.fromObject(model).toObject(ApiProperties.class); - Assertions.assertEquals(501010271, model.apiFreshnessTimeInMinutes()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityRequestTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index 7950d0be6978..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityRequestTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"fqpte\",\"type\":\"zzvypyqrimzinp\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("fqpte", model.name()); - Assertions.assertEquals("zzvypyqrimzinp", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model - = new CheckNameAvailabilityRequest().withName("fqpte").withType("zzvypyqrimzinp"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("fqpte", model.name()); - Assertions.assertEquals("zzvypyqrimzinp", model.type()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityResponseInnerTests.java deleted file mode 100644 index 100e2654f949..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityResponseInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityReason; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityResponseInner model = BinaryData - .fromString("{\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"irsoodqxhcrmnohj\"}") - .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("irsoodqxhcrmnohj", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponseInner model = new CheckNameAvailabilityResponseInner().withNameAvailable(false) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("irsoodqxhcrmnohj"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("irsoodqxhcrmnohj", model.message()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionInnerTests.java deleted file mode 100644 index 32ee222ee362..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.ExtensionInner; - -public final class ExtensionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionInner model = BinaryData.fromString( - "{\"properties\":{\"extensionId\":\"hdxbmtqio\",\"extensionCategory\":\"zehtbmu\",\"installedExtensionVersion\":\"ownoizhw\",\"extensionAuthLink\":\"xybqsoqij\",\"extensionApiDocsLink\":\"dmbpazlobcufpdz\",\"additionalApiProperties\":{\"qqjnqgl\":{\"apiFreshnessTimeInMinutes\":895933338},\"nufo\":{\"apiFreshnessTimeInMinutes\":2127527772}}},\"eTag\":\"jywif\",\"id\":\"esaagdfm\",\"name\":\"lzl\",\"type\":\"j\"}") - .toObject(ExtensionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionInner model = new ExtensionInner(); - model = BinaryData.fromObject(model).toObject(ExtensionInner.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionInstallationRequestTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionInstallationRequestTests.java deleted file mode 100644 index ebb99f8cf3e9..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionInstallationRequestTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.ApiProperties; -import com.azure.resourcemanager.agrifood.models.ExtensionInstallationRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ExtensionInstallationRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionInstallationRequest model = BinaryData.fromString( - "{\"extensionVersion\":\"mhquvgjxp\",\"additionalApiProperties\":{\"ehmtzop\":{\"apiFreshnessTimeInMinutes\":128065962},\"h\":{\"apiFreshnessTimeInMinutes\":2143816909},\"idgsybbe\":{\"apiFreshnessTimeInMinutes\":2050900245},\"hoycm\":{\"apiFreshnessTimeInMinutes\":318397575}}}") - .toObject(ExtensionInstallationRequest.class); - Assertions.assertEquals("mhquvgjxp", model.extensionVersion()); - Assertions.assertEquals(128065962, model.additionalApiProperties().get("ehmtzop").apiFreshnessTimeInMinutes()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionInstallationRequest model = new ExtensionInstallationRequest().withExtensionVersion("mhquvgjxp") - .withAdditionalApiProperties(mapOf("ehmtzop", new ApiProperties().withApiFreshnessTimeInMinutes(128065962), - "h", new ApiProperties().withApiFreshnessTimeInMinutes(2143816909), "idgsybbe", - new ApiProperties().withApiFreshnessTimeInMinutes(2050900245), "hoycm", - new ApiProperties().withApiFreshnessTimeInMinutes(318397575))); - model = BinaryData.fromObject(model).toObject(ExtensionInstallationRequest.class); - Assertions.assertEquals("mhquvgjxp", model.extensionVersion()); - Assertions.assertEquals(128065962, model.additionalApiProperties().get("ehmtzop").apiFreshnessTimeInMinutes()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionListResponseTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionListResponseTests.java deleted file mode 100644 index da4c19fc80b8..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionListResponseTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.ExtensionInner; -import com.azure.resourcemanager.agrifood.models.ExtensionListResponse; -import java.util.Arrays; - -public final class ExtensionListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionListResponse model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"extensionId\":\"deupewnwrei\",\"extensionCategory\":\"zyf\",\"installedExtensionVersion\":\"sarhmofc\",\"extensionAuthLink\":\"smy\",\"extensionApiDocsLink\":\"kdtmlxhekuk\",\"additionalApiProperties\":{\"kc\":{\"apiFreshnessTimeInMinutes\":1983903346},\"arcryuanzwuxzdxt\":{\"apiFreshnessTimeInMinutes\":1422058480}}},\"eTag\":\"rlhm\",\"id\":\"fp\",\"name\":\"rqobmtuk\",\"type\":\"nryrtihf\"}],\"nextLink\":\"ijbpzvgnwzsymgl\"}") - .toObject(ExtensionListResponse.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionListResponse model = new ExtensionListResponse().withValue(Arrays.asList(new ExtensionInner())); - model = BinaryData.fromObject(model).toObject(ExtensionListResponse.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionPropertiesTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionPropertiesTests.java deleted file mode 100644 index e397b5708543..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.ExtensionProperties; - -public final class ExtensionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionProperties model = BinaryData.fromString( - "{\"extensionId\":\"ifkwmrvktsizntoc\",\"extensionCategory\":\"a\",\"installedExtensionVersion\":\"ajpsquc\",\"extensionAuthLink\":\"o\",\"extensionApiDocsLink\":\"dkfo\",\"additionalApiProperties\":{\"jofjd\":{\"apiFreshnessTimeInMinutes\":1562879445}}}") - .toObject(ExtensionProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionProperties model = new ExtensionProperties(); - model = BinaryData.fromObject(model).toObject(ExtensionProperties.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateOrUpdateWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 4a3753c14228..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.ApiProperties; -import com.azure.resourcemanager.agrifood.models.Extension; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"extensionId\":\"kzwpcnpw\",\"extensionCategory\":\"jaesgvvsccya\",\"installedExtensionVersion\":\"uq\",\"extensionAuthLink\":\"wygzlvdnkfxusem\",\"extensionApiDocsLink\":\"zrmuhapfcqdps\",\"additionalApiProperties\":{\"svuo\":{\"apiFreshnessTimeInMinutes\":124988622},\"ccelve\":{\"apiFreshnessTimeInMinutes\":434335068},\"pqlmfe\":{\"apiFreshnessTimeInMinutes\":808786975}}},\"eTag\":\"erqwkyhkobopg\",\"id\":\"dkow\",\"name\":\"pbqpcrfkbwccsn\",\"type\":\"vcdwxlpqekftn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Extension response = manager.extensions() - .define("yqtfihwh") - .withExistingFarmBeat("ukndxdigrjgu", "fzdm") - .withExtensionVersion("tzingamvpph") - .withAdditionalApiProperties( - mapOf("udphqamvdkfwyn", new ApiProperties().withApiFreshnessTimeInMinutes(1174017685), "tbvkayhmtnvyq", - new ApiProperties().withApiFreshnessTimeInMinutes(1976240660))) - .create(); - - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsDeleteWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsDeleteWithResponseMockTests.java deleted file mode 100644 index 3b1308fcec03..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.extensions().deleteWithResponse("gzrf", "eeyebi", "ikayuhqlbjbsybb", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsGetWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsGetWithResponseMockTests.java deleted file mode 100644 index b920f21e0b08..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsGetWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.Extension; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"extensionId\":\"hkr\",\"extensionCategory\":\"bdeibqipqk\",\"installedExtensionVersion\":\"vxndz\",\"extensionAuthLink\":\"krefajpjo\",\"extensionApiDocsLink\":\"kqnyh\",\"additionalApiProperties\":{\"jivfxzsjabib\":{\"apiFreshnessTimeInMinutes\":1108411974}}},\"eTag\":\"stawfsdjpvkv\",\"id\":\"jxbkzbzkdvn\",\"name\":\"jabudurgkakmo\",\"type\":\"zhjjklffhmouwq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Extension response = manager.extensions() - .getWithResponse("unyowxwl", "djrkvfgbvfvpd", "odacizs", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsMockTests.java deleted file mode 100644 index 6e9f25aacea0..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.Extension; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionsListByFarmBeatsMockTests { - @Test - public void testListByFarmBeats() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"extensionId\":\"ikpzimejza\",\"extensionCategory\":\"fzxiavrmb\",\"installedExtensionVersion\":\"nokixrjqcirgz\",\"extensionAuthLink\":\"rlazszrnw\",\"extensionApiDocsLink\":\"indfpwpjyl\",\"additionalApiProperties\":{\"flsjc\":{\"apiFreshnessTimeInMinutes\":85653434},\"zfjvfbgofe\":{\"apiFreshnessTimeInMinutes\":1421362478},\"grqmqhldvrii\":{\"apiFreshnessTimeInMinutes\":72622543},\"nalghfkvtvsexso\":{\"apiFreshnessTimeInMinutes\":1657950244}}},\"eTag\":\"el\",\"id\":\"hhahhxvrhmzkwpjg\",\"name\":\"wspughftqsxhqx\",\"type\":\"j\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.extensions() - .listByFarmBeats("wrv", "ldgmfpgvmpip", Arrays.asList("ltha", "fxssm"), Arrays.asList("twbdsrezpdrhn"), - 51733848, "yowqkdwytisibir", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsDeleteByResourceGroupWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 4c2d061d4b74..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class FarmBeatsModelsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.farmBeatsModels() - .deleteByResourceGroupWithResponse("edltmmjihyeozp", "vwau", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsSolutionInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsSolutionInnerTests.java deleted file mode 100644 index 655b9d985690..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsSolutionInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsSolutionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsSolutionProperties; -import com.azure.resourcemanager.agrifood.models.MarketplaceOfferDetails; -import org.junit.jupiter.api.Assertions; - -public final class FarmBeatsSolutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FarmBeatsSolutionInner model = BinaryData.fromString( - "{\"properties\":{\"partnerId\":\"wsvlxotogtwrupqs\",\"partnerTenantId\":\"nmic\",\"dataAccessScopes\":[\"ceoveilovno\"],\"marketplaceOfferDetails\":{\"saasOfferId\":\"jfcn\",\"publisherId\":\"k\"},\"inputParametersValidationScopes\":[{\"resourceIdName\":\"hbttkphyw\",\"resourceType\":\"vjtoqnermclfp\"}],\"openApiSpecsDictionary\":{\"azqugxywpmueefj\":\"dataoxuscrpabgyepsbj\",\"dsuyonobgla\":\"datawfqkquj\"},\"evaluatedOutputsDictionary\":{\"lupj\":{\"insightResponse\":{\"farmerId\":\"ccm\",\"modelId\":\"udxytlmoyrx\",\"resourceType\":\"fudwpznt\",\"resourceId\":\"dzhlrq\",\"modelVersion\":\"hckfrlhrx\",\"insightStartDateTime\":\"2021-04-13T09:17:59Z\",\"insightEndDateTime\":\"2021-04-25T23:27:30Z\",\"measures\":{\"ca\":{},\"uzbpzkafku\":{},\"b\":{},\"rnwb\":{}},\"id\":\"hhseyv\",\"status\":\"srtslhspkdeem\",\"createdDateTime\":\"2021-02-20T10:46:34Z\",\"modifiedDateTime\":\"2021-10-29T03:55:40Z\",\"eTag\":\"gkvtmelmqkrhah\",\"name\":\"juahaquhcdhmdual\",\"description\":\"xqpvfadmw\",\"properties\":{\"vxpvgomz\":\"datar\",\"bnbbeldawkz\":\"datafmisg\",\"urqhaka\":\"dataali\"}},\"insightAttachmentResponse\":{\"insightId\":\"shsfwxosowzxcu\",\"modelId\":\"cjooxdjebwpucwwf\",\"resourceType\":\"vbvmeu\",\"resourceId\":\"ivyhzceuojgjrwju\",\"fileLink\":\"otwmcdyt\",\"originalFileName\":\"wit\",\"farmerId\":\"rjaw\",\"id\":\"wgxhn\",\"status\":\"kxfbkpycgklwndn\",\"createdDateTime\":\"2021-06-18T07:43:59Z\",\"modifiedDateTime\":\"2021-02-14T21:50:58Z\",\"name\":\"hvylwzbt\",\"description\":\"xujznbmpowu\",\"eTag\":\"rzqlveu\"}},\"n\":{\"insightResponse\":{\"farmerId\":\"fxobbcsws\",\"modelId\":\"jriplrbpbewtghf\",\"resourceType\":\"lcgwxzvlvqh\",\"resourceId\":\"begibtnmxiebwwa\",\"modelVersion\":\"ayqcgw\",\"insightStartDateTime\":\"2021-06-14T10:56:53Z\",\"insightEndDateTime\":\"2021-07-21T21:53:41Z\",\"measures\":{\"wyzmhtxon\":{},\"mtsavjcbpwxqp\":{}},\"id\":\"knftguvriuh\",\"status\":\"wmdyvxqtay\",\"createdDateTime\":\"2021-10-05T16:00:46Z\",\"modifiedDateTime\":\"2021-02-01T07:07:12Z\",\"eTag\":\"yqbexrmcqibycno\",\"name\":\"knme\",\"description\":\"sgzvahapjyzhpv\",\"properties\":{\"gfhzovawjvzunlut\":\"datacjrvxdjzlmwlxkv\",\"i\":\"datannprn\",\"tskzbbtdzumveek\":\"dataeilpjzuaejxdu\",\"uh\":\"datapwo\"}},\"insightAttachmentResponse\":{\"insightId\":\"bsjyofdx\",\"modelId\":\"us\",\"resourceType\":\"touwaboekqv\",\"resourceId\":\"lns\",\"fileLink\":\"bxwyjsflhhcaa\",\"originalFileName\":\"jixisxyawjoyaqcs\",\"farmerId\":\"jpkiidzyexznelix\",\"id\":\"rzt\",\"status\":\"lhbnxkna\",\"createdDateTime\":\"2021-09-05T19:55:42Z\",\"modifiedDateTime\":\"2021-05-26T22:03:53Z\",\"name\":\"ggdtpnapnyiro\",\"description\":\"hpigv\",\"eTag\":\"ylgqgitxmedjvcsl\"}},\"hin\":{\"insightResponse\":{\"farmerId\":\"ncw\",\"modelId\":\"hxg\",\"resourceType\":\"rmgucnap\",\"resourceId\":\"eoellwptfdygp\",\"modelVersion\":\"b\",\"insightStartDateTime\":\"2021-01-13T17:58:58Z\",\"insightEndDateTime\":\"2021-05-26T18:03:20Z\",\"measures\":{\"fqrhhuaopppc\":{}},\"id\":\"qxolzdahzx\",\"status\":\"obgbkdmoizp\",\"createdDateTime\":\"2021-09-17T06:54:06Z\",\"modifiedDateTime\":\"2021-02-03T18:27:02Z\",\"eTag\":\"cfbu\",\"name\":\"mfqjhhkxbp\",\"description\":\"ymjhxxjyngudivkr\",\"properties\":{\"szjfauvjfdxxivet\":\"databxqz\",\"qaqtdoqmcbxvwvxy\":\"datat\",\"obl\":\"datalqbhsf\"}},\"insightAttachmentResponse\":{\"insightId\":\"blmpewww\",\"modelId\":\"krvrns\",\"resourceType\":\"hqjohxcrsbfova\",\"resourceId\":\"ruvw\",\"fileLink\":\"sqfsubcgjbirxb\",\"originalFileName\":\"bsrfbj\",\"farmerId\":\"twss\",\"id\":\"ftpvjzbexil\",\"status\":\"nfqqnvwp\",\"createdDateTime\":\"2021-08-13T08:01:40Z\",\"modifiedDateTime\":\"2021-06-07T17:58:08Z\",\"name\":\"oujmkcjhwqytj\",\"description\":\"bnw\",\"eTag\":\"wgdrjervnaenqp\"}}},\"accessFBApplicationId\":\"7ea96623-e215-4b36-bcfd-1e246332ed5a\",\"saaSApplicationId\":\"a52f21ed-094e-4376-987d-95a80110db4b\",\"actionIds\":[\"ifthnz\",\"ndslgnayqigynduh\",\"vhqlkthumaqo\"],\"roleId\":\"gycdu\",\"roleName\":\"r\",\"accessFBApplicationName\":\"ccymvaolpsslql\"},\"id\":\"mdnbbglzpswiy\",\"name\":\"mcwyhzdxssadb\",\"type\":\"mnvdfzn\"}") - .toObject(FarmBeatsSolutionInner.class); - Assertions.assertEquals("jfcn", model.properties().marketplaceOfferDetails().saasOfferId()); - Assertions.assertEquals("k", model.properties().marketplaceOfferDetails().publisherId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FarmBeatsSolutionInner model = new FarmBeatsSolutionInner().withProperties(new FarmBeatsSolutionProperties() - .withMarketplaceOfferDetails(new MarketplaceOfferDetails().withSaasOfferId("jfcn").withPublisherId("k"))); - model = BinaryData.fromObject(model).toObject(FarmBeatsSolutionInner.class); - Assertions.assertEquals("jfcn", model.properties().marketplaceOfferDetails().saasOfferId()); - Assertions.assertEquals("k", model.properties().marketplaceOfferDetails().publisherId()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsSolutionPropertiesTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsSolutionPropertiesTests.java deleted file mode 100644 index bab495b23bee..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsSolutionPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.FarmBeatsSolutionProperties; -import com.azure.resourcemanager.agrifood.models.MarketplaceOfferDetails; -import org.junit.jupiter.api.Assertions; - -public final class FarmBeatsSolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FarmBeatsSolutionProperties model = BinaryData.fromString( - "{\"partnerId\":\"ao\",\"partnerTenantId\":\"xzb\",\"dataAccessScopes\":[\"lylpstdb\",\"hxsrzdzucersc\",\"ntnev\"],\"marketplaceOfferDetails\":{\"saasOfferId\":\"jmygtdsslswtmwer\",\"publisherId\":\"fzp\"},\"inputParametersValidationScopes\":[{\"resourceIdName\":\"mwabnetshhszhedp\",\"resourceType\":\"wiwubm\"},{\"resourceIdName\":\"besldnkwwtppjflc\",\"resourceType\":\"gaokonzmnsikv\"},{\"resourceIdName\":\"qzeqqkdltfzxm\",\"resourceType\":\"v\"}],\"openApiSpecsDictionary\":{\"odkwobd\":\"datar\"},\"evaluatedOutputsDictionary\":{\"xrslpm\":{\"insightResponse\":{\"farmerId\":\"bqdxbx\",\"modelId\":\"kbogqxndlkzgx\",\"resourceType\":\"ripl\",\"resourceId\":\"odxun\",\"modelVersion\":\"ebxmubyynt\",\"insightStartDateTime\":\"2021-07-30T15:53:47Z\",\"insightEndDateTime\":\"2021-07-20T21:35:25Z\",\"measures\":{\"auwzizxbmpgc\":{\"unit\":\"ievseotgqrllt\",\"value\":76.4560281327405},\"rp\":{\"unit\":\"fuzmuvpbtt\",\"value\":91.29423913433995}},\"id\":\"ebmnzbtbhjpglk\",\"status\":\"ohdneuel\",\"createdDateTime\":\"2021-04-04T13:11:17Z\",\"modifiedDateTime\":\"2021-09-10T03:53:24Z\",\"eTag\":\"htozfikdow\",\"name\":\"uuvxz\",\"description\":\"lvithhqzonosgg\",\"properties\":{\"n\":\"dataohfwds\"}},\"insightAttachmentResponse\":{\"insightId\":\"jutiiswacff\",\"modelId\":\"k\",\"resourceType\":\"ewkfvhqcrai\",\"resourceId\":\"pnppfuf\",\"fileLink\":\"wdmhdlxyjrxs\",\"originalFileName\":\"afcnih\",\"farmerId\":\"qapnedgfbcv\",\"id\":\"vq\",\"status\":\"keqdcvdrhvoods\",\"createdDateTime\":\"2021-11-02T01:53:07Z\",\"modifiedDateTime\":\"2021-03-29T00:37:52Z\",\"name\":\"dopcjwvnh\",\"description\":\"d\",\"eTag\":\"gx\"}},\"aeneqnzarrwl\":{\"insightResponse\":{\"farmerId\":\"uoegrpkhjwniyqs\",\"modelId\":\"i\",\"resourceType\":\"dggkzzlvmbmpa\",\"resourceId\":\"odfvuefywsbp\",\"modelVersion\":\"mwyhr\",\"insightStartDateTime\":\"2021-01-24T04:18:46Z\",\"insightEndDateTime\":\"2021-03-28T00:46:50Z\",\"measures\":{\"mnubexkpzksmond\":{\"unit\":\"kcpwiy\",\"value\":69.61685109503964}},\"id\":\"quxvypomgkop\",\"status\":\"hojvpajqgxysmocm\",\"createdDateTime\":\"2021-06-10T23:57:32Z\",\"modifiedDateTime\":\"2021-08-15T23:09:36Z\",\"eTag\":\"kcxozapvhelx\",\"name\":\"glyatddckcbcuej\",\"description\":\"xgc\",\"properties\":{\"sxsdqrhzoymibm\":\"databrh\",\"hwflu\":\"dataqyib\",\"voqacpiexpbt\":\"datazdtmhrkwofy\"}},\"insightAttachmentResponse\":{\"insightId\":\"bwoenwashrt\",\"modelId\":\"kcnqxwbpo\",\"resourceType\":\"lpiujwaa\",\"resourceId\":\"pqiiobyuqe\",\"fileLink\":\"qlpqwcciuq\",\"originalFileName\":\"dbutauvfbtkuwhh\",\"farmerId\":\"ykojoxafnndlpic\",\"id\":\"o\",\"status\":\"kcdyhbpk\",\"createdDateTime\":\"2021-02-04T17:28:33Z\",\"modifiedDateTime\":\"2021-08-10T05:34:19Z\",\"name\":\"q\",\"description\":\"vvqfovljxyws\",\"eTag\":\"syrsndsytgadgvra\"}},\"wczelpci\":{\"insightResponse\":{\"farmerId\":\"ijfqkacewiipfp\",\"modelId\":\"ji\",\"resourceType\":\"wifto\",\"resourceId\":\"kvpuvksgplsaknyn\",\"modelVersion\":\"ynl\",\"insightStartDateTime\":\"2021-02-28T17:47:31Z\",\"insightEndDateTime\":\"2021-04-21T04:25:24Z\",\"measures\":{\"jswsrmslyz\":{\"unit\":\"dlqiyntorzih\",\"value\":39.11110981530672},\"zynkedya\":{\"unit\":\"zbchckqqzqioxiy\",\"value\":90.07096442312648},\"ynpcdpumnzgmwznm\":{\"unit\":\"wyhqmibzyhwits\",\"value\":16.77750928870466},\"tlwwrlk\":{\"unit\":\"iknsorgjh\",\"value\":40.86477682375702}},\"id\":\"tncvokot\",\"status\":\"xdy\",\"createdDateTime\":\"2021-07-08T09:31:36Z\",\"modifiedDateTime\":\"2021-10-28T18:31:30Z\",\"eTag\":\"ogjltdtbnnhad\",\"name\":\"crkvcikhnv\",\"description\":\"mqg\",\"properties\":{\"zikywgg\":\"datau\",\"uipiccjzk\":\"datakallatmel\"}},\"insightAttachmentResponse\":{\"insightId\":\"gvvcnayrhyr\",\"modelId\":\"xmueed\",\"resourceType\":\"rdvstkwqqtch\",\"resourceId\":\"lmfmtdaay\",\"fileLink\":\"v\",\"originalFileName\":\"gpiohgwxrtfudxe\",\"farmerId\":\"gyqagvrvmnpkuk\",\"id\":\"i\",\"status\":\"blxgwimf\",\"createdDateTime\":\"2021-12-10T08:58:19Z\",\"modifiedDateTime\":\"2021-09-01T04:07:41Z\",\"name\":\"wmszkk\",\"description\":\"qreyfkzi\",\"eTag\":\"jawneaiv\"}},\"fw\":{\"insightResponse\":{\"farmerId\":\"sfeaenwabfat\",\"modelId\":\"ddxbjhwuaanoz\",\"resourceType\":\"sphyoulpjrvxa\",\"resourceId\":\"rvimjwosytxitcsk\",\"modelVersion\":\"k\",\"insightStartDateTime\":\"2021-05-30T00:33:28Z\",\"insightEndDateTime\":\"2021-05-16T01:14:52Z\",\"measures\":{\"ly\":{\"unit\":\"ez\",\"value\":20.615747097446345},\"g\":{\"unit\":\"hdgqggeb\",\"value\":24.67376724896586},\"dsuvarmywdmjsjqb\":{\"unit\":\"qidbqfatpxllrxcy\",\"value\":47.302666373756466},\"mareqnajxqugj\":{\"unit\":\"hyxxrwlycoduhpk\",\"value\":33.53602716321977}},\"id\":\"ycubeddgs\",\"status\":\"fwqmzqalkrmn\",\"createdDateTime\":\"2021-01-22T20:56:52Z\",\"modifiedDateTime\":\"2021-12-03T00:29:17Z\",\"eTag\":\"cqqudf\",\"name\":\"yxbaaabjyvayf\",\"description\":\"m\",\"properties\":{\"fdnw\":\"datatuzqogsexne\",\"euzsoi\":\"datawmewzsyy\"}},\"insightAttachmentResponse\":{\"insightId\":\"dpfrxtrthzvaytdw\",\"modelId\":\"brqubp\",\"resourceType\":\"h\",\"resourceId\":\"iilivpdtiirqtd\",\"fileLink\":\"axoruzfgsquy\",\"originalFileName\":\"rxxle\",\"farmerId\":\"ramxjezwlwnw\",\"id\":\"qlcvydy\",\"status\":\"tdooaoj\",\"createdDateTime\":\"2021-02-12T17:14:45Z\",\"modifiedDateTime\":\"2021-02-18T00:56:22Z\",\"name\":\"oo\",\"description\":\"wnujhemmsbvdk\",\"eTag\":\"odtji\"}}},\"accessFBApplicationId\":\"ac0a407d-2239-41ea-9f7b-25f15cd83a6a\",\"saaSApplicationId\":\"721e1977-b176-4c00-a5cd-f37afd3fdbe4\",\"actionIds\":[\"kacjvefkdlfo\",\"kggkfpa\"],\"roleId\":\"owpulpq\",\"roleName\":\"ylsyxkqjnsje\",\"accessFBApplicationName\":\"tiagx\"}") - .toObject(FarmBeatsSolutionProperties.class); - Assertions.assertEquals("jmygtdsslswtmwer", model.marketplaceOfferDetails().saasOfferId()); - Assertions.assertEquals("fzp", model.marketplaceOfferDetails().publisherId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FarmBeatsSolutionProperties model = new FarmBeatsSolutionProperties().withMarketplaceOfferDetails( - new MarketplaceOfferDetails().withSaasOfferId("jmygtdsslswtmwer").withPublisherId("fzp")); - model = BinaryData.fromObject(model).toObject(FarmBeatsSolutionProperties.class); - Assertions.assertEquals("jmygtdsslswtmwer", model.marketplaceOfferDetails().saasOfferId()); - Assertions.assertEquals("fzp", model.marketplaceOfferDetails().publisherId()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/IdentityTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/IdentityTests.java deleted file mode 100644 index ad8dd65839ca..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/IdentityTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.Identity; -import com.azure.resourcemanager.agrifood.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = BinaryData.fromString( - "{\"principalId\":\"33d47ceb-84fd-410e-94a1-8d988d4955dd\",\"tenantId\":\"ffeca805-3f02-48a5-8195-7860a006c196\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/InsightAttachmentTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/InsightAttachmentTests.java deleted file mode 100644 index ca2d891092ce..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/InsightAttachmentTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.InsightAttachment; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class InsightAttachmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InsightAttachment model = BinaryData.fromString( - "{\"insightId\":\"sfgytguslfead\",\"modelId\":\"gq\",\"resourceType\":\"yhejhzisxgfp\",\"resourceId\":\"olppvksrpqvujz\",\"fileLink\":\"ehtwdwrft\",\"originalFileName\":\"iby\",\"farmerId\":\"dl\",\"id\":\"shfwpracstwity\",\"status\":\"evxccedcp\",\"createdDateTime\":\"2021-05-27T10:40:38Z\",\"modifiedDateTime\":\"2021-02-03T02:01:52Z\",\"name\":\"nwzxltjcv\",\"description\":\"ltiugcxnavv\",\"eTag\":\"qiby\"}") - .toObject(InsightAttachment.class); - Assertions.assertEquals("sfgytguslfead", model.insightId()); - Assertions.assertEquals("gq", model.modelId()); - Assertions.assertEquals("yhejhzisxgfp", model.resourceType()); - Assertions.assertEquals("olppvksrpqvujz", model.resourceId()); - Assertions.assertEquals("ehtwdwrft", model.fileLink()); - Assertions.assertEquals("iby", model.originalFileName()); - Assertions.assertEquals("dl", model.farmerId()); - Assertions.assertEquals("shfwpracstwity", model.id()); - Assertions.assertEquals("evxccedcp", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-27T10:40:38Z"), model.createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-03T02:01:52Z"), model.modifiedDateTime()); - Assertions.assertEquals("nwzxltjcv", model.name()); - Assertions.assertEquals("ltiugcxnavv", model.description()); - Assertions.assertEquals("qiby", model.etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InsightAttachment model = new InsightAttachment().withInsightId("sfgytguslfead") - .withModelId("gq") - .withResourceType("yhejhzisxgfp") - .withResourceId("olppvksrpqvujz") - .withFileLink("ehtwdwrft") - .withOriginalFileName("iby") - .withFarmerId("dl") - .withId("shfwpracstwity") - .withStatus("evxccedcp") - .withCreatedDateTime(OffsetDateTime.parse("2021-05-27T10:40:38Z")) - .withModifiedDateTime(OffsetDateTime.parse("2021-02-03T02:01:52Z")) - .withName("nwzxltjcv") - .withDescription("ltiugcxnavv") - .withEtag("qiby"); - model = BinaryData.fromObject(model).toObject(InsightAttachment.class); - Assertions.assertEquals("sfgytguslfead", model.insightId()); - Assertions.assertEquals("gq", model.modelId()); - Assertions.assertEquals("yhejhzisxgfp", model.resourceType()); - Assertions.assertEquals("olppvksrpqvujz", model.resourceId()); - Assertions.assertEquals("ehtwdwrft", model.fileLink()); - Assertions.assertEquals("iby", model.originalFileName()); - Assertions.assertEquals("dl", model.farmerId()); - Assertions.assertEquals("shfwpracstwity", model.id()); - Assertions.assertEquals("evxccedcp", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-27T10:40:38Z"), model.createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-03T02:01:52Z"), model.modifiedDateTime()); - Assertions.assertEquals("nwzxltjcv", model.name()); - Assertions.assertEquals("ltiugcxnavv", model.description()); - Assertions.assertEquals("qiby", model.etag()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/InsightTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/InsightTests.java deleted file mode 100644 index 42518ab5e045..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/InsightTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.Insight; -import com.azure.resourcemanager.agrifood.models.Measure; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InsightTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Insight model = BinaryData.fromString( - "{\"farmerId\":\"rqf\",\"modelId\":\"wyznkbyku\",\"resourceType\":\"pfhpagmhrskdsnfd\",\"resourceId\":\"oakgtdlmkkzev\",\"modelVersion\":\"hewpusdsttwv\",\"insightStartDateTime\":\"2021-06-20T15:11:08Z\",\"insightEndDateTime\":\"2021-04-23T12:39:39Z\",\"measures\":{\"grtwae\":{\"unit\":\"cngqqmoakufgmjz\",\"value\":34.07437496986774},\"hhziuief\":{\"unit\":\"uzkopbminrfd\",\"value\":42.966341818508845}},\"id\":\"bhdmsmlmzqhof\",\"status\":\"maequiahxicslfa\",\"createdDateTime\":\"2021-11-28T10:16:40Z\",\"modifiedDateTime\":\"2021-01-04T13:19:25Z\",\"eTag\":\"ylhalnswhcc\",\"name\":\"hka\",\"description\":\"witqscywuggwoluh\",\"properties\":{\"ai\":\"datawem\",\"wmsweypqwd\":\"datasbrgz\",\"mkttlstvlzywem\":\"dataggicccnxqhue\"}}") - .toObject(Insight.class); - Assertions.assertEquals("rqf", model.farmerId()); - Assertions.assertEquals("wyznkbyku", model.modelId()); - Assertions.assertEquals("pfhpagmhrskdsnfd", model.resourceType()); - Assertions.assertEquals("oakgtdlmkkzev", model.resourceId()); - Assertions.assertEquals("hewpusdsttwv", model.modelVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-20T15:11:08Z"), model.insightStartDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-23T12:39:39Z"), model.insightEndDateTime()); - Assertions.assertEquals("cngqqmoakufgmjz", model.measures().get("grtwae").unit()); - Assertions.assertEquals(34.07437496986774D, model.measures().get("grtwae").value()); - Assertions.assertEquals("bhdmsmlmzqhof", model.id()); - Assertions.assertEquals("maequiahxicslfa", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-28T10:16:40Z"), model.createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-04T13:19:25Z"), model.modifiedDateTime()); - Assertions.assertEquals("ylhalnswhcc", model.etag()); - Assertions.assertEquals("hka", model.name()); - Assertions.assertEquals("witqscywuggwoluh", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Insight model = new Insight().withFarmerId("rqf") - .withModelId("wyznkbyku") - .withResourceType("pfhpagmhrskdsnfd") - .withResourceId("oakgtdlmkkzev") - .withModelVersion("hewpusdsttwv") - .withInsightStartDateTime(OffsetDateTime.parse("2021-06-20T15:11:08Z")) - .withInsightEndDateTime(OffsetDateTime.parse("2021-04-23T12:39:39Z")) - .withMeasures(mapOf("grtwae", new Measure().withUnit("cngqqmoakufgmjz").withValue(34.07437496986774D), - "hhziuief", new Measure().withUnit("uzkopbminrfd").withValue(42.966341818508845D))) - .withId("bhdmsmlmzqhof") - .withStatus("maequiahxicslfa") - .withCreatedDateTime(OffsetDateTime.parse("2021-11-28T10:16:40Z")) - .withModifiedDateTime(OffsetDateTime.parse("2021-01-04T13:19:25Z")) - .withEtag("ylhalnswhcc") - .withName("hka") - .withDescription("witqscywuggwoluh") - .withProperties(mapOf("ai", "datawem", "wmsweypqwd", "datasbrgz", "mkttlstvlzywem", "dataggicccnxqhue")); - model = BinaryData.fromObject(model).toObject(Insight.class); - Assertions.assertEquals("rqf", model.farmerId()); - Assertions.assertEquals("wyznkbyku", model.modelId()); - Assertions.assertEquals("pfhpagmhrskdsnfd", model.resourceType()); - Assertions.assertEquals("oakgtdlmkkzev", model.resourceId()); - Assertions.assertEquals("hewpusdsttwv", model.modelVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-20T15:11:08Z"), model.insightStartDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-23T12:39:39Z"), model.insightEndDateTime()); - Assertions.assertEquals("cngqqmoakufgmjz", model.measures().get("grtwae").unit()); - Assertions.assertEquals(34.07437496986774D, model.measures().get("grtwae").value()); - Assertions.assertEquals("bhdmsmlmzqhof", model.id()); - Assertions.assertEquals("maequiahxicslfa", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-28T10:16:40Z"), model.createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-04T13:19:25Z"), model.modifiedDateTime()); - Assertions.assertEquals("ylhalnswhcc", model.etag()); - Assertions.assertEquals("hka", model.name()); - Assertions.assertEquals("witqscywuggwoluh", model.description()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index b0a79ef7fd94..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"tw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResponse response = manager.locations() - .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityRequest().withName("ratiz").withType("onasxifto"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("tw", response.message()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/MarketplaceOfferDetailsTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/MarketplaceOfferDetailsTests.java deleted file mode 100644 index 1c5d19ecfd1e..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/MarketplaceOfferDetailsTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.MarketplaceOfferDetails; -import org.junit.jupiter.api.Assertions; - -public final class MarketplaceOfferDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MarketplaceOfferDetails model - = BinaryData.fromString("{\"saasOfferId\":\"sz\",\"publisherId\":\"mpsbzkfzbeyv\"}") - .toObject(MarketplaceOfferDetails.class); - Assertions.assertEquals("sz", model.saasOfferId()); - Assertions.assertEquals("mpsbzkfzbeyv", model.publisherId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MarketplaceOfferDetails model - = new MarketplaceOfferDetails().withSaasOfferId("sz").withPublisherId("mpsbzkfzbeyv"); - model = BinaryData.fromObject(model).toObject(MarketplaceOfferDetails.class); - Assertions.assertEquals("sz", model.saasOfferId()); - Assertions.assertEquals("mpsbzkfzbeyv", model.publisherId()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/MeasureTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/MeasureTests.java deleted file mode 100644 index 07656beedfff..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/MeasureTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.Measure; -import org.junit.jupiter.api.Assertions; - -public final class MeasureTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Measure model - = BinaryData.fromString("{\"unit\":\"rncsdtclu\",\"value\":99.38934674886448}").toObject(Measure.class); - Assertions.assertEquals("rncsdtclu", model.unit()); - Assertions.assertEquals(99.38934674886448D, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Measure model = new Measure().withUnit("rncsdtclu").withValue(99.38934674886448D); - model = BinaryData.fromObject(model).toObject(Measure.class); - Assertions.assertEquals("rncsdtclu", model.unit()); - Assertions.assertEquals(99.38934674886448D, model.value()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationDisplayTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationDisplayTests.java deleted file mode 100644 index 962e805c3633..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"hbcsgl\",\"resource\":\"majtjaod\",\"operation\":\"bnbdxkqpxokajion\",\"description\":\"mexgstxgcp\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationInnerTests.java deleted file mode 100644 index f11a0bd3b4b2..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.OperationInner; -import com.azure.resourcemanager.agrifood.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"a\",\"isDataAction\":true,\"display\":{\"provider\":\"tqajzyulpkudjkrl\",\"resource\":\"bzhfepgzgqexz\",\"operation\":\"c\",\"description\":\"c\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationListResultTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationListResultTests.java deleted file mode 100644 index 8c4a29d62947..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"h\",\"isDataAction\":true,\"display\":{\"provider\":\"iy\",\"resource\":\"jxsqwpgrjbz\",\"operation\":\"rcjxvsnbyxqabn\",\"description\":\"cpc\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"afbljjgpbtoqcjmk\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationsListMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationsListMockTests.java deleted file mode 100644 index 7a0c5c45415c..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationsListMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"gogczhonnxkrlgny\",\"isDataAction\":false,\"display\":{\"provider\":\"xkk\",\"resource\":\"h\",\"operation\":\"gh\",\"description\":\"bdhqxvcxgf\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index d42100750611..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.agrifood.models.PrivateEndpoint; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"groupIds\":[\"likwyqkgfgib\",\"adgakeqsrxybz\",\"qedqytbciqfoufl\",\"mnkzsmod\"],\"privateEndpoint\":{\"id\":\"ougpbkwt\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"uqktap\",\"actionsRequired\":\"wgcu\"},\"provisioningState\":\"Failed\"},\"id\":\"mkdo\",\"name\":\"vqwhbmdgbbjfd\",\"type\":\"gmbmbexppbh\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("uqktap", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("wgcu", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model - = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("uqktap") - .withActionsRequired("wgcu")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("uqktap", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("wgcu", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionListResultTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index ae307401a1b5..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.agrifood.models.PrivateEndpoint; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupIds\":[\"jrmvdjwzrlo\",\"mcl\",\"hijco\",\"jctbza\"],\"privateEndpoint\":{\"id\":\"sycbkbfk\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"kexxppof\",\"actionsRequired\":\"axcfjpgddtocjjx\"},\"provisioningState\":\"Deleting\"},\"id\":\"o\",\"name\":\"exhd\",\"type\":\"xibqeojnx\"},{\"properties\":{\"groupIds\":[\"ddntwndei\",\"btwnpzaoqvuhrhcf\"],\"privateEndpoint\":{\"id\":\"ddglm\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"qkwpyeicxmqc\",\"actionsRequired\":\"q\"},\"provisioningState\":\"Failed\"},\"id\":\"ixuigdtopbobj\",\"name\":\"ghmewuam\",\"type\":\"uhrzayvvt\"}]}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("kexxppof", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("axcfjpgddtocjjx", - model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model - = new PrivateEndpointConnectionListResult() - .withValue(Arrays.asList( - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("kexxppof") - .withActionsRequired("axcfjpgddtocjjx")), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("qkwpyeicxmqc") - .withActionsRequired("q")))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("kexxppof", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("axcfjpgddtocjjx", - model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 82a820481080..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.agrifood.models.PrivateEndpoint; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"groupIds\":[\"rolfpfp\",\"algbquxigjyjg\"],\"privateEndpoint\":{\"id\":\"o\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"txilnerkujy\",\"actionsRequired\":\"l\"},\"provisioningState\":\"Deleting\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("txilnerkujy", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("l", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("txilnerkujy") - .withActionsRequired("l")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("txilnerkujy", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("l", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 12bdf66562a7..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.PrivateEndpoint; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnection; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"jgcyztsfmznba\",\"qphchqnrnrpxehuw\"],\"privateEndpoint\":{\"id\":\"qgaifmviklbydv\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"jdz\",\"actionsRequired\":\"cvdsrhnj\"},\"provisioningState\":\"Deleting\"},\"id\":\"v\",\"name\":\"novqfzge\",\"type\":\"jdftuljltd\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .define("xifqjzgxm") - .withExistingFarmBeat("rsre", "zvxurisjnhny") - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("qntcypsxjvfoimwk") - .withActionsRequired("ircizjxvy")) - .create(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("jdz", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cvdsrhnj", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteMockTests.java deleted file mode 100644 index ae8992803d21..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.privateEndpointConnections().delete("cy", "wzdgirujbzbo", "vzzbtdcq", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 01668883417a..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnection; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupIds\":[\"f\",\"wnopqgikyzirtx\",\"yuxzejntpsewgi\",\"ilqu\"],\"privateEndpoint\":{\"id\":\"dxtqmieoxo\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"f\",\"actionsRequired\":\"aomtbghhavgrvkff\"},\"provisioningState\":\"Failed\"},\"id\":\"hpjbib\",\"name\":\"jmfxumvf\",\"type\":\"luyovwxnbkfezzx\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("fbshrnsvbuswd", "z", "ybycnunvj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("f", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("aomtbghhavgrvkff", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceMockTests.java deleted file mode 100644 index f97d1650cad0..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnection; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByResourceMockTests { - @Test - public void testListByResource() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupIds\":[\"bgye\",\"rymsgaojfmw\"],\"privateEndpoint\":{\"id\":\"tmr\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ctymoxoftp\",\"actionsRequired\":\"iwyczuh\"},\"provisioningState\":\"Deleting\"},\"id\":\"qjlihhyuspska\",\"name\":\"dvlmfwdgzxul\",\"type\":\"cvpa\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateEndpointConnections() - .listByResource("pniyujviyl", "dshf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ctymoxoftp", - response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("iwyczuh", - response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointTests.java deleted file mode 100644 index 99dd45afbb25..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"fqawrlyxw\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index 212142d0fff9..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"eipheoflokeyy\",\"requiredMembers\":[\"jbdlwtgrhpdjpju\"],\"requiredZoneNames\":[\"xazjpqyegual\",\"b\"]},\"id\":\"hejjz\",\"name\":\"v\",\"type\":\"udgwdslfho\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("xazjpqyegual", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model - = new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("xazjpqyegual", "b")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("xazjpqyegual", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceListResultTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index fde6a2ba9105..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.agrifood.models.PrivateLinkResourceListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"giotkftutqxlngx\",\"requiredMembers\":[\"gug\",\"xkrxdqmi\",\"tthzrvqd\",\"abhjybi\"],\"requiredZoneNames\":[\"oqfbowskanyk\"]},\"id\":\"lcuiywgqywgndr\",\"name\":\"ynhz\",\"type\":\"pphrcgynco\"},{\"properties\":{\"groupId\":\"cfvmmco\",\"requiredMembers\":[\"xlzevgbmqjqabcy\",\"mivkwlzuvcc\",\"wnfnbacf\"],\"requiredZoneNames\":[\"l\",\"bxetqgtzxdpn\",\"bqqwxrj\",\"eallnwsubisnj\"]},\"id\":\"pmng\",\"name\":\"zscxaqwo\",\"type\":\"chcbonqvpkvlrxnj\"}]}") - .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("oqfbowskanyk", model.value().get(0).requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = new PrivateLinkResourceListResult().withValue( - Arrays.asList(new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("oqfbowskanyk")), - new PrivateLinkResourceInner() - .withRequiredZoneNames(Arrays.asList("l", "bxetqgtzxdpn", "bqqwxrj", "eallnwsubisnj")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("oqfbowskanyk", model.value().get(0).requiredZoneNames().get(0)); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcePropertiesTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 048e7608872e..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"mcy\",\"requiredMembers\":[\"lbjnpgacftadehx\",\"ltyfsop\",\"usue\",\"nzwdejba\"],\"requiredZoneNames\":[\"xzdmohctb\",\"vudwx\",\"ndnvo\",\"gujjugwdkcglh\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("xzdmohctb", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("xzdmohctb", "vudwx", "ndnvo", "gujjugwdkcglh")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("xzdmohctb", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesGetWithResponseMockTests.java deleted file mode 100644 index e060edd08f05..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupId\":\"tgk\",\"requiredMembers\":[\"vdxec\",\"zedqbcvhzlhplo\",\"qkdlw\"],\"requiredZoneNames\":[\"bum\",\"kxtrq\"]},\"id\":\"smlmbtxhwgfwsrta\",\"name\":\"coezbrhubskh\",\"type\":\"dyg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResource response = manager.privateLinkResources() - .getWithResponse("uodpv", "uudl", "zibt", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bum", response.requiredZoneNames().get(0)); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceMockTests.java deleted file mode 100644 index d57976fd4acd..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByResourceMockTests { - @Test - public void testListByResource() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"wcw\",\"requiredMembers\":[\"oknssxmojmsvpkjp\",\"vk\",\"cfzq\"],\"requiredZoneNames\":[\"x\",\"tczheydbsdshmkx\"]},\"id\":\"ehvbbxurip\",\"name\":\"tfnhtbaxkgxywr\",\"type\":\"kpyklyhp\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.privateLinkResources().listByResource("ceamtm", "zuo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("x", response.iterator().next().requiredZoneNames().get(0)); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index fde0b7a807c9..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = BinaryData - .fromString("{\"status\":\"Rejected\",\"description\":\"rbnwbxgjvtbvpy\",\"actionsRequired\":\"zdn\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("rbnwbxgjvtbvpy", model.description()); - Assertions.assertEquals("zdn", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("rbnwbxgjvtbvpy") - .withActionsRequired("zdn"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("rbnwbxgjvtbvpy", model.description()); - Assertions.assertEquals("zdn", model.actionsRequired()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ResourceParameterTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ResourceParameterTests.java deleted file mode 100644 index 3d95e0dfa11c..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ResourceParameterTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.ResourceParameter; -import org.junit.jupiter.api.Assertions; - -public final class ResourceParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceParameter model - = BinaryData.fromString("{\"resourceIdName\":\"qi\",\"resourceType\":\"invkjjxdxrbuu\"}") - .toObject(ResourceParameter.class); - Assertions.assertEquals("qi", model.resourceIdName()); - Assertions.assertEquals("invkjjxdxrbuu", model.resourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceParameter model = new ResourceParameter().withResourceIdName("qi").withResourceType("invkjjxdxrbuu"); - model = BinaryData.fromObject(model).toObject(ResourceParameter.class); - Assertions.assertEquals("qi", model.resourceIdName()); - Assertions.assertEquals("invkjjxdxrbuu", model.resourceType()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionEvaluatedOutputTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionEvaluatedOutputTests.java deleted file mode 100644 index 2381fc656f52..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionEvaluatedOutputTests.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.Insight; -import com.azure.resourcemanager.agrifood.models.InsightAttachment; -import com.azure.resourcemanager.agrifood.models.Measure; -import com.azure.resourcemanager.agrifood.models.SolutionEvaluatedOutput; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SolutionEvaluatedOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SolutionEvaluatedOutput model = BinaryData.fromString( - "{\"insightResponse\":{\"farmerId\":\"lewyhmlwpaz\",\"modelId\":\"pofncck\",\"resourceType\":\"fz\",\"resourceId\":\"hxx\",\"modelVersion\":\"yq\",\"insightStartDateTime\":\"2020-12-30T00:37:41Z\",\"insightEndDateTime\":\"2021-07-31T20:27:49Z\",\"measures\":{\"altol\":{\"unit\":\"ppriol\",\"value\":64.46224529416375},\"dcfhucqdpf\":{\"unit\":\"cwsobqwcs\",\"value\":42.05402405040643},\"bvtvudutncormr\":{\"unit\":\"glsbjjc\",\"value\":14.321605063519183},\"knnqvsaznq\":{\"unit\":\"qtvcofudflvkgj\",\"value\":37.783006681052555}},\"id\":\"orudsgsa\",\"status\":\"kycgrauwj\",\"createdDateTime\":\"2021-04-03T17:36:18Z\",\"modifiedDateTime\":\"2020-12-26T00:25:40Z\",\"eTag\":\"uruv\",\"name\":\"ovsm\",\"description\":\"xwabmqoe\",\"properties\":{\"mqlgk\":\"datafrvtpuqu\",\"ongbjcnt\":\"databtndo\"}},\"insightAttachmentResponse\":{\"insightId\":\"tcje\",\"modelId\":\"twwaezkojvdcpzf\",\"resourceType\":\"ouicybxarzgszu\",\"resourceId\":\"x\",\"fileLink\":\"q\",\"originalFileName\":\"idoamciodhkha\",\"farmerId\":\"khnzbonlw\",\"id\":\"oegokdwbwh\",\"status\":\"z\",\"createdDateTime\":\"2021-11-07T16:03:36Z\",\"modifiedDateTime\":\"2021-02-20T22:35:17Z\",\"name\":\"xztvbtqgsfraoyzk\",\"description\":\"wtl\",\"eTag\":\"guxawqaldsyuuxi\"}}") - .toObject(SolutionEvaluatedOutput.class); - Assertions.assertEquals("lewyhmlwpaz", model.insightResponse().farmerId()); - Assertions.assertEquals("pofncck", model.insightResponse().modelId()); - Assertions.assertEquals("fz", model.insightResponse().resourceType()); - Assertions.assertEquals("hxx", model.insightResponse().resourceId()); - Assertions.assertEquals("yq", model.insightResponse().modelVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-30T00:37:41Z"), - model.insightResponse().insightStartDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T20:27:49Z"), - model.insightResponse().insightEndDateTime()); - Assertions.assertEquals("ppriol", model.insightResponse().measures().get("altol").unit()); - Assertions.assertEquals(64.46224529416375D, model.insightResponse().measures().get("altol").value()); - Assertions.assertEquals("orudsgsa", model.insightResponse().id()); - Assertions.assertEquals("kycgrauwj", model.insightResponse().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T17:36:18Z"), - model.insightResponse().createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-26T00:25:40Z"), - model.insightResponse().modifiedDateTime()); - Assertions.assertEquals("uruv", model.insightResponse().etag()); - Assertions.assertEquals("ovsm", model.insightResponse().name()); - Assertions.assertEquals("xwabmqoe", model.insightResponse().description()); - Assertions.assertEquals("tcje", model.insightAttachmentResponse().insightId()); - Assertions.assertEquals("twwaezkojvdcpzf", model.insightAttachmentResponse().modelId()); - Assertions.assertEquals("ouicybxarzgszu", model.insightAttachmentResponse().resourceType()); - Assertions.assertEquals("x", model.insightAttachmentResponse().resourceId()); - Assertions.assertEquals("q", model.insightAttachmentResponse().fileLink()); - Assertions.assertEquals("idoamciodhkha", model.insightAttachmentResponse().originalFileName()); - Assertions.assertEquals("khnzbonlw", model.insightAttachmentResponse().farmerId()); - Assertions.assertEquals("oegokdwbwh", model.insightAttachmentResponse().id()); - Assertions.assertEquals("z", model.insightAttachmentResponse().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T16:03:36Z"), - model.insightAttachmentResponse().createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T22:35:17Z"), - model.insightAttachmentResponse().modifiedDateTime()); - Assertions.assertEquals("xztvbtqgsfraoyzk", model.insightAttachmentResponse().name()); - Assertions.assertEquals("wtl", model.insightAttachmentResponse().description()); - Assertions.assertEquals("guxawqaldsyuuxi", model.insightAttachmentResponse().etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SolutionEvaluatedOutput model = new SolutionEvaluatedOutput() - .withInsightResponse(new Insight().withFarmerId("lewyhmlwpaz") - .withModelId("pofncck") - .withResourceType("fz") - .withResourceId("hxx") - .withModelVersion("yq") - .withInsightStartDateTime(OffsetDateTime.parse("2020-12-30T00:37:41Z")) - .withInsightEndDateTime(OffsetDateTime.parse("2021-07-31T20:27:49Z")) - .withMeasures(mapOf("altol", new Measure().withUnit("ppriol").withValue(64.46224529416375D), - "dcfhucqdpf", new Measure().withUnit("cwsobqwcs").withValue(42.05402405040643D), "bvtvudutncormr", - new Measure().withUnit("glsbjjc").withValue(14.321605063519183D), "knnqvsaznq", - new Measure().withUnit("qtvcofudflvkgj").withValue(37.783006681052555D))) - .withId("orudsgsa") - .withStatus("kycgrauwj") - .withCreatedDateTime(OffsetDateTime.parse("2021-04-03T17:36:18Z")) - .withModifiedDateTime(OffsetDateTime.parse("2020-12-26T00:25:40Z")) - .withEtag("uruv") - .withName("ovsm") - .withDescription("xwabmqoe") - .withProperties(mapOf("mqlgk", "datafrvtpuqu", "ongbjcnt", "databtndo"))) - .withInsightAttachmentResponse(new InsightAttachment().withInsightId("tcje") - .withModelId("twwaezkojvdcpzf") - .withResourceType("ouicybxarzgszu") - .withResourceId("x") - .withFileLink("q") - .withOriginalFileName("idoamciodhkha") - .withFarmerId("khnzbonlw") - .withId("oegokdwbwh") - .withStatus("z") - .withCreatedDateTime(OffsetDateTime.parse("2021-11-07T16:03:36Z")) - .withModifiedDateTime(OffsetDateTime.parse("2021-02-20T22:35:17Z")) - .withName("xztvbtqgsfraoyzk") - .withDescription("wtl") - .withEtag("guxawqaldsyuuxi")); - model = BinaryData.fromObject(model).toObject(SolutionEvaluatedOutput.class); - Assertions.assertEquals("lewyhmlwpaz", model.insightResponse().farmerId()); - Assertions.assertEquals("pofncck", model.insightResponse().modelId()); - Assertions.assertEquals("fz", model.insightResponse().resourceType()); - Assertions.assertEquals("hxx", model.insightResponse().resourceId()); - Assertions.assertEquals("yq", model.insightResponse().modelVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-30T00:37:41Z"), - model.insightResponse().insightStartDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T20:27:49Z"), - model.insightResponse().insightEndDateTime()); - Assertions.assertEquals("ppriol", model.insightResponse().measures().get("altol").unit()); - Assertions.assertEquals(64.46224529416375D, model.insightResponse().measures().get("altol").value()); - Assertions.assertEquals("orudsgsa", model.insightResponse().id()); - Assertions.assertEquals("kycgrauwj", model.insightResponse().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T17:36:18Z"), - model.insightResponse().createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-26T00:25:40Z"), - model.insightResponse().modifiedDateTime()); - Assertions.assertEquals("uruv", model.insightResponse().etag()); - Assertions.assertEquals("ovsm", model.insightResponse().name()); - Assertions.assertEquals("xwabmqoe", model.insightResponse().description()); - Assertions.assertEquals("tcje", model.insightAttachmentResponse().insightId()); - Assertions.assertEquals("twwaezkojvdcpzf", model.insightAttachmentResponse().modelId()); - Assertions.assertEquals("ouicybxarzgszu", model.insightAttachmentResponse().resourceType()); - Assertions.assertEquals("x", model.insightAttachmentResponse().resourceId()); - Assertions.assertEquals("q", model.insightAttachmentResponse().fileLink()); - Assertions.assertEquals("idoamciodhkha", model.insightAttachmentResponse().originalFileName()); - Assertions.assertEquals("khnzbonlw", model.insightAttachmentResponse().farmerId()); - Assertions.assertEquals("oegokdwbwh", model.insightAttachmentResponse().id()); - Assertions.assertEquals("z", model.insightAttachmentResponse().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T16:03:36Z"), - model.insightAttachmentResponse().createdDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T22:35:17Z"), - model.insightAttachmentResponse().modifiedDateTime()); - Assertions.assertEquals("xztvbtqgsfraoyzk", model.insightAttachmentResponse().name()); - Assertions.assertEquals("wtl", model.insightAttachmentResponse().description()); - Assertions.assertEquals("guxawqaldsyuuxi", model.insightAttachmentResponse().etag()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionInnerTests.java deleted file mode 100644 index 3ec4fcbdf375..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionInnerTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.SolutionInner; -import com.azure.resourcemanager.agrifood.models.SolutionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SolutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SolutionInner model = BinaryData.fromString( - "{\"properties\":{\"solutionId\":\"ocfs\",\"partnerId\":\"s\",\"saasSubscriptionId\":\"mddystkiiux\",\"saasSubscriptionName\":\"qyud\",\"marketplacePublisherId\":\"o\",\"planId\":\"rq\",\"offerId\":\"b\",\"termId\":\"oczvy\",\"\":{\"vdfwatkpn\":\"datarvkdvjsllrm\",\"wiqzbqjvsovmyo\":\"dataulexxbczwtr\"}},\"eTag\":\"cspkwlhzdobpxjmf\",\"id\":\"vvnchrkcc\",\"name\":\"wwzjuqkhrsajiwku\",\"type\":\"foskghsauuimj\"}") - .toObject(SolutionInner.class); - Assertions.assertEquals("mddystkiiux", model.properties().saasSubscriptionId()); - Assertions.assertEquals("qyud", model.properties().saasSubscriptionName()); - Assertions.assertEquals("o", model.properties().marketplacePublisherId()); - Assertions.assertEquals("rq", model.properties().planId()); - Assertions.assertEquals("b", model.properties().offerId()); - Assertions.assertEquals("oczvy", model.properties().termId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SolutionInner model - = new SolutionInner().withProperties(new SolutionProperties().withSaasSubscriptionId("mddystkiiux") - .withSaasSubscriptionName("qyud") - .withMarketplacePublisherId("o") - .withPlanId("rq") - .withOfferId("b") - .withTermId("oczvy") - .withAdditionalProperties(mapOf("solutionId", "ocfs", "partnerId", "s"))); - model = BinaryData.fromObject(model).toObject(SolutionInner.class); - Assertions.assertEquals("mddystkiiux", model.properties().saasSubscriptionId()); - Assertions.assertEquals("qyud", model.properties().saasSubscriptionName()); - Assertions.assertEquals("o", model.properties().marketplacePublisherId()); - Assertions.assertEquals("rq", model.properties().planId()); - Assertions.assertEquals("b", model.properties().offerId()); - Assertions.assertEquals("oczvy", model.properties().termId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionInstallationRequestTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionInstallationRequestTests.java deleted file mode 100644 index 883a981ff0db..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionInstallationRequestTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.SolutionInstallationRequest; -import com.azure.resourcemanager.agrifood.models.SolutionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SolutionInstallationRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SolutionInstallationRequest model = BinaryData.fromString( - "{\"properties\":{\"solutionId\":\"zj\",\"partnerId\":\"ggd\",\"saasSubscriptionId\":\"jixhbk\",\"saasSubscriptionName\":\"ofqweykhmenevfye\",\"marketplacePublisherId\":\"fwhybcibvy\",\"planId\":\"dcsi\",\"offerId\":\"ynnaam\",\"termId\":\"ectehf\",\"\":{\"ypvhezrkg\":\"datacj\",\"sle\":\"datahcjrefovgmk\"}}}") - .toObject(SolutionInstallationRequest.class); - Assertions.assertEquals("jixhbk", model.properties().saasSubscriptionId()); - Assertions.assertEquals("ofqweykhmenevfye", model.properties().saasSubscriptionName()); - Assertions.assertEquals("fwhybcibvy", model.properties().marketplacePublisherId()); - Assertions.assertEquals("dcsi", model.properties().planId()); - Assertions.assertEquals("ynnaam", model.properties().offerId()); - Assertions.assertEquals("ectehf", model.properties().termId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SolutionInstallationRequest model - = new SolutionInstallationRequest().withProperties(new SolutionProperties().withSaasSubscriptionId("jixhbk") - .withSaasSubscriptionName("ofqweykhmenevfye") - .withMarketplacePublisherId("fwhybcibvy") - .withPlanId("dcsi") - .withOfferId("ynnaam") - .withTermId("ectehf") - .withAdditionalProperties(mapOf("solutionId", "zj", "partnerId", "ggd"))); - model = BinaryData.fromObject(model).toObject(SolutionInstallationRequest.class); - Assertions.assertEquals("jixhbk", model.properties().saasSubscriptionId()); - Assertions.assertEquals("ofqweykhmenevfye", model.properties().saasSubscriptionName()); - Assertions.assertEquals("fwhybcibvy", model.properties().marketplacePublisherId()); - Assertions.assertEquals("dcsi", model.properties().planId()); - Assertions.assertEquals("ynnaam", model.properties().offerId()); - Assertions.assertEquals("ectehf", model.properties().termId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionPropertiesTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionPropertiesTests.java deleted file mode 100644 index 12ce5d7b4a7e..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionPropertiesTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.SolutionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SolutionProperties model = BinaryData.fromString( - "{\"solutionId\":\"vxyqjpkcattpngjc\",\"partnerId\":\"czsqpjhvm\",\"saasSubscriptionId\":\"ajvnysounqe\",\"saasSubscriptionName\":\"a\",\"marketplacePublisherId\":\"oaeupfhyhltrpmo\",\"planId\":\"jmcmatuokthfu\",\"offerId\":\"uaodsfcpk\",\"termId\":\"xodpuozmyzydagfu\",\"\":{\"ywqsmbsurexim\":\"dataezyiuokktwhrdxw\"}}") - .toObject(SolutionProperties.class); - Assertions.assertEquals("ajvnysounqe", model.saasSubscriptionId()); - Assertions.assertEquals("a", model.saasSubscriptionName()); - Assertions.assertEquals("oaeupfhyhltrpmo", model.marketplacePublisherId()); - Assertions.assertEquals("jmcmatuokthfu", model.planId()); - Assertions.assertEquals("uaodsfcpk", model.offerId()); - Assertions.assertEquals("xodpuozmyzydagfu", model.termId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SolutionProperties model = new SolutionProperties().withSaasSubscriptionId("ajvnysounqe") - .withSaasSubscriptionName("a") - .withMarketplacePublisherId("oaeupfhyhltrpmo") - .withPlanId("jmcmatuokthfu") - .withOfferId("uaodsfcpk") - .withTermId("xodpuozmyzydagfu") - .withAdditionalProperties(mapOf("solutionId", "vxyqjpkcattpngjc", "partnerId", "czsqpjhvm")); - model = BinaryData.fromObject(model).toObject(SolutionProperties.class); - Assertions.assertEquals("ajvnysounqe", model.saasSubscriptionId()); - Assertions.assertEquals("a", model.saasSubscriptionName()); - Assertions.assertEquals("oaeupfhyhltrpmo", model.marketplacePublisherId()); - Assertions.assertEquals("jmcmatuokthfu", model.planId()); - Assertions.assertEquals("uaodsfcpk", model.offerId()); - Assertions.assertEquals("xodpuozmyzydagfu", model.termId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsCreateOrUpdateWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index ee726eff563a..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.Solution; -import com.azure.resourcemanager.agrifood.models.SolutionProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SolutionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"solutionId\":\"vlerchpqbmfpjba\",\"partnerId\":\"idfcxsspuunnoxyh\",\"saasSubscriptionId\":\"xgqddrih\",\"saasSubscriptionName\":\"fhoqca\",\"marketplacePublisherId\":\"ewda\",\"planId\":\"mdjvlpj\",\"offerId\":\"xkzb\",\"termId\":\"msgeivsiykzk\",\"\":{\"zoggculapz\":\"datajdxon\"}},\"eTag\":\"rpgogtqxep\",\"id\":\"lbfu\",\"name\":\"jlyjtlvofq\",\"type\":\"hvfcibyfmow\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Solution response = manager.solutions() - .define("jgslordilmyww") - .withExistingFarmBeat("bteoybf", "jxakv") - .withProperties(new SolutionProperties().withSaasSubscriptionId("vudtjuewbcihx") - .withSaasSubscriptionName("uwhcjyxccybv") - .withMarketplacePublisherId("ayakkudzpx") - .withPlanId("wjplma") - .withOfferId("stcyohpfkyrkdbd") - .withTermId("iogsjkmnwq") - .withAdditionalProperties(mapOf("solutionId", "kxn", "partnerId", "dabg"))) - .create(); - - Assertions.assertEquals("xgqddrih", response.properties().saasSubscriptionId()); - Assertions.assertEquals("fhoqca", response.properties().saasSubscriptionName()); - Assertions.assertEquals("ewda", response.properties().marketplacePublisherId()); - Assertions.assertEquals("mdjvlpj", response.properties().planId()); - Assertions.assertEquals("xkzb", response.properties().offerId()); - Assertions.assertEquals("msgeivsiykzk", response.properties().termId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsDeleteWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsDeleteWithResponseMockTests.java deleted file mode 100644 index 58b7be83fa35..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SolutionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.solutions().deleteWithResponse("pjuohminyfl", "orwmduvwpklv", "w", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilitiesGetWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilitiesGetWithResponseMockTests.java deleted file mode 100644 index 2abc48f146a4..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilitiesGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.FarmBeatsSolution; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SolutionsDiscoverabilitiesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"partnerId\":\"zhe\",\"partnerTenantId\":\"yhohujswtwkozzwc\",\"dataAccessScopes\":[\"bawpfajnjwltlwt\"],\"marketplaceOfferDetails\":{\"saasOfferId\":\"uktalhsnvkcdmxz\",\"publisherId\":\"oaimlnw\"},\"inputParametersValidationScopes\":[{\"resourceIdName\":\"mylweazulc\",\"resourceType\":\"thwwn\"},{\"resourceIdName\":\"hlf\",\"resourceType\":\"wpchwahf\"}],\"openApiSpecsDictionary\":{\"ncxykxhdjhlimm\":\"datasnfepgfewetwlyx\",\"cjzhqi\":\"datacxfhbcporxv\",\"ftjuh\":\"dataxfpxtgqscja\"},\"evaluatedOutputsDictionary\":{\"pqfrtqlkz\":{\"insightResponse\":{\"farmerId\":\"mtggu\",\"modelId\":\"ijr\",\"resourceType\":\"civmmg\",\"resourceId\":\"cf\",\"modelVersion\":\"rxgkne\",\"insightStartDateTime\":\"2021-03-10T19:40:09Z\",\"insightEndDateTime\":\"2021-10-18T16:16:50Z\",\"measures\":{\"o\":{},\"fvpgshoxgsg\":{}},\"id\":\"fgzdjtxvz\",\"status\":\"bqvgaqv\",\"createdDateTime\":\"2020-12-28T03:47:06Z\",\"modifiedDateTime\":\"2021-05-28T12:54:39Z\",\"eTag\":\"usrd\",\"name\":\"t\",\"description\":\"sdtutnwlduyc\",\"properties\":{\"kuqgsjjxundxgket\":\"datahyrmewipmvekdx\",\"gpmuneqsxvmhfbuz\":\"datazhhzjhfjmhvvmu\",\"ms\":\"datayihsasbhudypohyu\"}},\"insightAttachmentResponse\":{\"insightId\":\"sqy\",\"modelId\":\"foobrlttyms\",\"resourceType\":\"ygqdnfwqzdz\",\"resourceId\":\"ilaxhn\",\"fileLink\":\"qlyvijo\",\"originalFileName\":\"iv\",\"farmerId\":\"oyzunbixxr\",\"id\":\"kvcpwpgclr\",\"status\":\"vtsoxf\",\"createdDateTime\":\"2021-03-24T12:08Z\",\"modifiedDateTime\":\"2021-06-22T22:32:01Z\",\"name\":\"m\",\"description\":\"efrp\",\"eTag\":\"dnqqskawaoqvmmb\"}},\"ypq\":{\"insightResponse\":{\"farmerId\":\"nitgvkxlz\",\"modelId\":\"drf\",\"resourceType\":\"cealzxwh\",\"resourceId\":\"nsymoyqhlwigd\",\"modelVersion\":\"bkbxgomfa\",\"insightStartDateTime\":\"2021-01-02T04:50:38Z\",\"insightEndDateTime\":\"2021-04-21T20:12:36Z\",\"measures\":{\"daeyygux\":{},\"kjsqzhzbezkgi\":{},\"sidxasicdd\":{},\"vvjskgfmocwahp\":{}},\"id\":\"atjeaahh\",\"status\":\"hhnakzybbj\",\"createdDateTime\":\"2020-12-31T00:42:58Z\",\"modifiedDateTime\":\"2021-10-17T04:29:53Z\",\"eTag\":\"yxkyxvx\",\"name\":\"blbjedn\",\"description\":\"lageuaulxun\",\"properties\":{\"ppxynenls\":\"databn\",\"klnsrmffey\":\"dataxeizzg\"}},\"insightAttachmentResponse\":{\"insightId\":\"ktp\",\"modelId\":\"merteeammxqiek\",\"resourceType\":\"zddrt\",\"resourceId\":\"doj\",\"fileLink\":\"xv\",\"originalFileName\":\"refdee\",\"farmerId\":\"ecuijpxtxs\",\"id\":\"prtujwsawdd\",\"status\":\"babxvitit\",\"createdDateTime\":\"2020-12-21T14:24:59Z\",\"modifiedDateTime\":\"2021-02-16T14:52:22Z\",\"name\":\"avoxtfg\",\"description\":\"cd\",\"eTag\":\"qbw\"}},\"ecj\":{\"insightResponse\":{\"farmerId\":\"fjacbslhhxudb\",\"modelId\":\"odhtnsirudhzm\",\"resourceType\":\"sckdlp\",\"resourceId\":\"zrcxfailcfxwmdbo\",\"modelVersion\":\"fgsftufqob\",\"insightStartDateTime\":\"2021-10-28T00:56:19Z\",\"insightEndDateTime\":\"2021-10-21T12:11:09Z\",\"measures\":{\"cc\":{},\"knh\":{},\"kizvytn\":{},\"zvulj\":{}},\"id\":\"aeranokqgukkjqnv\",\"status\":\"oylaxxul\",\"createdDateTime\":\"2021-04-08T11:51:17Z\",\"modifiedDateTime\":\"2021-11-21T05:22:10Z\",\"eTag\":\"sfjbjsvg\",\"name\":\"whryvycytdcl\",\"description\":\"ccknfnwmbtmvp\",\"properties\":{\"hk\":\"datadhttzaefedxihchr\",\"ylkdghrje\":\"datacrjdqnsdfzpbgtg\",\"bwnhhtql\":\"datautlwxezwzhok\",\"pifhpfeoajvgcxtx\":\"dataehgpp\"}},\"insightAttachmentResponse\":{\"insightId\":\"heafidlt\",\"modelId\":\"sr\",\"resourceType\":\"mks\",\"resourceId\":\"h\",\"fileLink\":\"ftxfkf\",\"originalFileName\":\"gpr\",\"farmerId\":\"tillucbiqtg\",\"id\":\"ohmcwsld\",\"status\":\"zetpwbra\",\"createdDateTime\":\"2021-09-22T07:04:47Z\",\"modifiedDateTime\":\"2021-04-27T21:01:18Z\",\"name\":\"hbqzmizakakankjp\",\"description\":\"jzhajoy\",\"eTag\":\"jlmuoyxprimrsopt\"}}},\"accessFBApplicationId\":\"e7e266ae-df78-425b-a493-82801289bb5a\",\"saaSApplicationId\":\"ace0e870-ab0a-4aef-9b77-73f470a81caa\",\"actionIds\":[\"stvasylwxdzaumw\"],\"roleId\":\"ohguuf\",\"roleName\":\"boyjathwt\",\"accessFBApplicationName\":\"lbaemwmdxmeb\"},\"id\":\"scjpahlxv\",\"name\":\"a\",\"type\":\"f\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FarmBeatsSolution response = manager.solutionsDiscoverabilities() - .getWithResponse("lftidgfcwqmpim", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("uktalhsnvkcdmxz", response.properties().marketplaceOfferDetails().saasOfferId()); - Assertions.assertEquals("oaimlnw", response.properties().marketplaceOfferDetails().publisherId()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilitiesListMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilitiesListMockTests.java deleted file mode 100644 index cc4ba70ac4e0..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilitiesListMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.FarmBeatsSolution; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SolutionsDiscoverabilitiesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"partnerId\":\"est\",\"partnerTenantId\":\"lx\",\"dataAccessScopes\":[\"lozapeewchpxlk\",\"wk\",\"ziycslevufuztck\",\"yhjtqedcgzu\"],\"marketplaceOfferDetails\":{\"saasOfferId\":\"mrqzzrrjvpgl\",\"publisherId\":\"zgkrvqe\"},\"inputParametersValidationScopes\":[{\"resourceIdName\":\"epr\",\"resourceType\":\"t\"},{\"resourceIdName\":\"ytp\",\"resourceType\":\"mov\"}],\"openApiSpecsDictionary\":{\"wzqa\":\"datava\",\"gzuriglaecxndt\":\"dataf\"},\"evaluatedOutputsDictionary\":{\"cdyuibhmfdnbzyd\":{\"insightResponse\":{\"farmerId\":\"vzm\",\"modelId\":\"t\",\"resourceType\":\"dgxobfircl\",\"resourceId\":\"kciayzri\",\"modelVersion\":\"hya\",\"insightStartDateTime\":\"2021-08-19T05:01:13Z\",\"insightEndDateTime\":\"2021-09-09T23:45:53Z\",\"measures\":{\"xqvkjlmxhomdyn\":{},\"dwdigumb\":{},\"raauzzpt\":{},\"a\":{}},\"id\":\"sdzhezww\",\"status\":\"iqyuvvfo\",\"createdDateTime\":\"2021-08-29T14:10:38Z\",\"modifiedDateTime\":\"2021-04-14T05:32:39Z\",\"eTag\":\"yik\",\"name\":\"lauyav\",\"description\":\"wmn\",\"properties\":{\"ekrsgs\":\"datatijfybvp\",\"huzqgn\":\"datab\",\"omtkub\":\"datadgkynscliqhzvhxn\",\"dxzxhi\":\"datatppn\"}},\"insightAttachmentResponse\":{\"insightId\":\"bbc\",\"modelId\":\"qagt\",\"resourceType\":\"dhlfkqojpykvgt\",\"resourceId\":\"cnifm\",\"fileLink\":\"sdymbrn\",\"originalFileName\":\"u\",\"farmerId\":\"prafwgckhoc\",\"id\":\"d\",\"status\":\"fwafqrouda\",\"createdDateTime\":\"2021-09-22T08:28:07Z\",\"modifiedDateTime\":\"2021-12-05T12:05:01Z\",\"name\":\"hrv\",\"description\":\"unzo\",\"eTag\":\"dhcxgkmoy\"}},\"y\":{\"insightResponse\":{\"farmerId\":\"fcjnaeoisrvhmgor\",\"modelId\":\"ukiscvwmzhw\",\"resourceType\":\"efaxvxilc\",\"resourceId\":\"gnhnzeyq\",\"modelVersion\":\"jjfzqlqhycavo\",\"insightStartDateTime\":\"2021-06-13T00:01:12Z\",\"insightEndDateTime\":\"2021-10-09T12:05:19Z\",\"measures\":{\"esmi\":{}},\"id\":\"nlrariaawiuagy\",\"status\":\"qfby\",\"createdDateTime\":\"2021-08-13T07:35:36Z\",\"modifiedDateTime\":\"2021-11-07T20:33:57Z\",\"eTag\":\"agt\",\"name\":\"jocqwogfnzjvusf\",\"description\":\"dmozu\",\"properties\":{\"ysownbtgkbug\":\"datafsbtkad\",\"pe\":\"datajqctojcmisofie\",\"hihihlhzdsqtzbsr\":\"dataojyqdhcuplcplcw\",\"hfgmvecactxm\":\"datanowc\"}},\"insightAttachmentResponse\":{\"insightId\":\"e\",\"modelId\":\"wcluqovekqvgq\",\"resourceType\":\"wifzmp\",\"resourceId\":\"yivqikfxcvhrfsp\",\"fileLink\":\"agr\",\"originalFileName\":\"ikteusqczkvyk\",\"farmerId\":\"ubyjaffmmf\",\"id\":\"cqc\",\"status\":\"bgq\",\"createdDateTime\":\"2021-03-05T16:25:57Z\",\"modifiedDateTime\":\"2021-03-09T09:52:03Z\",\"name\":\"metttwgd\",\"description\":\"qxihhrmooi\",\"eTag\":\"seypxiutcxapz\"}}},\"accessFBApplicationId\":\"61a3f634-63ca-4c75-8825-ece94917d699\",\"saaSApplicationId\":\"2a16c065-b10f-4678-9136-a08ff55e78cd\",\"actionIds\":[\"g\"],\"roleId\":\"joxslhvnhla\",\"roleName\":\"q\",\"accessFBApplicationName\":\"kzjcjbtrgae\"},\"id\":\"vibr\",\"name\":\"jj\",\"type\":\"toqbeitpkxztmoob\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.solutionsDiscoverabilities() - .list(Arrays.asList("rkjpvdwxfzwii", "wzjbh"), Arrays.asList("sxjrk", "mbtrnegvmnvu", "eqvldspast", "bkkd"), - 1749479057, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mrqzzrrjvpgl", - response.iterator().next().properties().marketplaceOfferDetails().saasOfferId()); - Assertions.assertEquals("zgkrvqe", - response.iterator().next().properties().marketplaceOfferDetails().publisherId()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetWithResponseMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetWithResponseMockTests.java deleted file mode 100644 index cf4c5966eefc..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.Solution; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SolutionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"solutionId\":\"bar\",\"partnerId\":\"uayjkqa\",\"saasSubscriptionId\":\"qgzsles\",\"saasSubscriptionName\":\"cbhernntiewdj\",\"marketplacePublisherId\":\"vbquwr\",\"planId\":\"ehwagoh\",\"offerId\":\"uffkmrqemvvh\",\"termId\":\"xtdr\",\"\":{\"ebjvewzcjzn\":\"datatac\",\"kahzo\":\"datawcpmguaadraufac\"}},\"eTag\":\"jjziuxxpsh\",\"id\":\"e\",\"name\":\"ulfgslqu\",\"type\":\"kwdlenrdsutujba\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Solution response = manager.solutions() - .getWithResponse("ookk", "fqjbvleo", "fmluiqtqzfavyvn", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qgzsles", response.properties().saasSubscriptionId()); - Assertions.assertEquals("cbhernntiewdj", response.properties().saasSubscriptionName()); - Assertions.assertEquals("vbquwr", response.properties().marketplacePublisherId()); - Assertions.assertEquals("ehwagoh", response.properties().planId()); - Assertions.assertEquals("uffkmrqemvvh", response.properties().offerId()); - Assertions.assertEquals("xtdr", response.properties().termId()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsListMockTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsListMockTests.java deleted file mode 100644 index 136ea92374f1..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SolutionsListMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.agrifood.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.Solution; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SolutionsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"solutionId\":\"nszqujiz\",\"partnerId\":\"oqytibyowbblgy\",\"saasSubscriptionId\":\"vutpthjoxo\",\"saasSubscriptionName\":\"smsks\",\"marketplacePublisherId\":\"pi\",\"planId\":\"lqol\",\"offerId\":\"xkcgxxlxsffgcvi\",\"termId\":\"qzdwlvwlyoup\",\"\":{\"owzfttsttkt\":\"databkjubdyhgkfmins\",\"itmmqtgqqqxh\":\"dataahbqactxtgzuk\",\"rxcpjuisavo\":\"datan\",\"ajlkatnw\":\"dataqdzfvazivjlfrqtt\"}},\"eTag\":\"iopid\",\"id\":\"qfkuvscxkdmli\",\"name\":\"ovibrxkp\",\"type\":\"loazuruocbgoo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AgriFoodManager manager = AgriFoodManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.solutions() - .list("ygdxpgpqchis", "epn", - Arrays.asList("jcrxgibbdaxcon", "ozauorsukokwb", "plhlvnuuepzlrp", "wzsoldweyuqdunv"), - Arrays.asList("nrwrbiork", "alywjhhgdn", "xmsivfomiloxggdu"), - Arrays.asList("q", "dieuzaofj", "hvcyyysfg"), Arrays.asList("tcubiipuipwoqonm", "cje"), - Arrays.asList("izsh", "vcimpev", "gmblrri"), OffsetDateTime.parse("2021-12-06T04:08:35Z"), - OffsetDateTime.parse("2021-10-31T20:00:27Z"), OffsetDateTime.parse("2021-01-10T12:14:20Z"), - OffsetDateTime.parse("2021-02-03T11:24:04Z"), 1550180718, "smiccwrwfscj", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vutpthjoxo", response.iterator().next().properties().saasSubscriptionId()); - Assertions.assertEquals("smsks", response.iterator().next().properties().saasSubscriptionName()); - Assertions.assertEquals("pi", response.iterator().next().properties().marketplacePublisherId()); - Assertions.assertEquals("lqol", response.iterator().next().properties().planId()); - Assertions.assertEquals("xkcgxxlxsffgcvi", response.iterator().next().properties().offerId()); - Assertions.assertEquals("qzdwlvwlyoup", response.iterator().next().properties().termId()); - } -}