From 1eb63c30b75f0e493b6eb95d03aaa89aaef6d94f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 24 Apr 2024 22:09:10 +0000 Subject: [PATCH] CodeGen from PR 3326 in test-repo-billy/azure-rest-api-specs Merge 18f0b01a308afa921d8ff6b4bf1c01a4b02946b5 into 26ae65b7cff0082d7acce6e28ac8d6739bc19745 --- .../CHANGELOG.md | 4 +- .../azure-resourcemanager-agrifood/README.md | 31 +- .../azure-resourcemanager-agrifood/SAMPLE.md | 811 +++++--- .../azure-resourcemanager-agrifood/pom.xml | 13 +- .../agrifood/AgriFoodManager.java | 231 ++- .../fluent/AgriFoodManagementClient.java | 82 +- ...ava => CheckNameAvailabilitiesClient.java} | 26 +- .../agrifood/fluent/DataConnectorsClient.java | 148 ++ ...anagerForAgricultureExtensionsClient.java} | 62 +- ...ManagerForAgricultureResourcesClient.java} | 214 +-- .../agrifood/fluent/ExtensionsClient.java | 121 +- .../fluent/OperationResultsClient.java | 43 + .../agrifood/fluent/OperationsClient.java | 16 +- .../PrivateEndpointConnectionsClient.java | 128 +- .../fluent/PrivateLinkResourcesClient.java | 56 +- .../agrifood/fluent/SolutionsClient.java | 154 ++ .../SolutionsDiscoverabilitiesClient.java | 72 + .../fluent/models/ArmAsyncOperationInner.java | 51 +- .../CheckNameAvailabilityResponseInner.java | 24 +- .../fluent/models/DataConnectorInner.java | 96 + ...taManagerForAgricultureExtensionInner.java | 76 + ...va => DataManagerForAgricultureInner.java} | 101 +- ... DataManagerForAgricultureProperties.java} | 63 +- ...ataManagerForAgricultureSolutionInner.java | 76 + .../fluent/models/ExtensionInner.java | 57 +- .../fluent/models/ExtensionProperties.java | 48 +- .../models/FarmBeatsExtensionInner.java | 149 -- .../fluent/models/OperationInner.java | 33 +- .../PrivateEndpointConnectionInner.java | 44 +- ...vateEndpointConnectionListResultInner.java | 58 + .../PrivateEndpointConnectionProperties.java | 56 +- .../models/PrivateLinkResourceInner.java | 28 +- .../PrivateLinkResourceListResultInner.java | 58 + .../models/PrivateLinkResourceProperties.java | 26 +- .../agrifood/fluent/models/SolutionInner.java | 90 + .../agrifood/fluent/models/package-info.java | 4 +- .../agrifood/fluent/package-info.java | 4 +- .../AgriFoodManagementClientBuilder.java | 52 +- .../AgriFoodManagementClientImpl.java | 258 ++- .../implementation/ArmAsyncOperationImpl.java | 9 +- ...=> CheckNameAvailabilitiesClientImpl.java} | 160 +- ....java => CheckNameAvailabilitiesImpl.java} | 37 +- .../CheckNameAvailabilityResponseImpl.java | 3 +- .../implementation/DataConnectorImpl.java | 143 ++ .../DataConnectorsClientImpl.java | 808 ++++++++ .../implementation/DataConnectorsImpl.java | 169 ++ ...ataManagerForAgricultureExtensionImpl.java | 50 + ...gerForAgricultureExtensionsClientImpl.java | 456 +++++ ...taManagerForAgricultureExtensionsImpl.java | 75 + .../DataManagerForAgricultureImpl.java | 238 +++ ...agerForAgricultureResourcesClientImpl.java | 1230 +++++++++++++ ...ataManagerForAgricultureResourcesImpl.java | 157 ++ ...DataManagerForAgricultureSolutionImpl.java | 50 + .../implementation/ExtensionImpl.java | 143 +- .../implementation/ExtensionsClientImpl.java | 994 ++++------ .../implementation/ExtensionsImpl.java | 186 +- .../FarmBeatsExtensionImpl.java | 93 - .../FarmBeatsExtensionsClientImpl.java | 550 ------ .../FarmBeatsExtensionsImpl.java | 85 - .../implementation/FarmBeatsImpl.java | 236 --- .../FarmBeatsModelsClientImpl.java | 1623 ----------------- .../implementation/FarmBeatsModelsImpl.java | 201 -- .../FarmBeatsPropertiesImpl.java | 58 - .../OperationResultsClientImpl.java | 187 ++ .../implementation/OperationResultsImpl.java | 56 + .../implementation/OperationsClientImpl.java | 169 +- .../implementation/OperationsImpl.java | 8 +- .../PrivateEndpointConnectionImpl.java | 112 +- ...ivateEndpointConnectionListResultImpl.java | 44 + .../PrivateEndpointConnectionsClientImpl.java | 779 ++++---- .../PrivateEndpointConnectionsImpl.java | 233 ++- .../PrivateLinkResourceImpl.java | 4 +- .../PrivateLinkResourceListResultImpl.java | 44 + .../PrivateLinkResourcesClientImpl.java | 336 ++-- .../PrivateLinkResourcesImpl.java | 59 +- .../{Utils.java => ResourceManagerUtils.java} | 43 +- .../agrifood/implementation/SolutionImpl.java | 141 ++ .../implementation/SolutionsClientImpl.java | 919 ++++++++++ .../SolutionsDiscoverabilitiesClientImpl.java | 422 +++++ .../SolutionsDiscoverabilitiesImpl.java | 73 + .../implementation/SolutionsImpl.java | 170 ++ .../agrifood/implementation/package-info.java | 4 +- .../agrifood/models/ActionType.java | 21 +- .../models/ApiKeyAuthCredentials.java | 87 + .../agrifood/models/ApiProperties.java | 56 + .../agrifood/models/ArmAsyncOperation.java | 17 +- .../models/ArmAsyncOperationError.java | 82 + .../agrifood/models/AuthCredentials.java | 54 + .../agrifood/models/AuthCredentialsKind.java | 53 + ...ions.java => CheckNameAvailabilities.java} | 26 +- .../models/CheckNameAvailabilityReason.java | 25 +- .../models/CheckNameAvailabilityRequest.java | 20 +- .../models/CheckNameAvailabilityResponse.java | 12 +- .../agrifood/models/DataConnector.java | 196 ++ .../models/DataConnectorListResponse.java | 92 + .../models/DataConnectorProperties.java | 64 + .../agrifood/models/DataConnectors.java | 161 ++ ...ts.java => DataManagerForAgriculture.java} | 214 ++- .../DataManagerForAgricultureExtension.java | 55 + ...erForAgricultureExtensionListResponse.java | 119 ++ ...gerForAgricultureExtensionProperties.java} | 66 +- ... DataManagerForAgricultureExtensions.java} | 60 +- ...DataManagerForAgricultureListResponse.java | 118 ++ ...> DataManagerForAgricultureResources.java} | 153 +- .../DataManagerForAgricultureSolution.java | 55 + ...gerForAgricultureSolutionListResponse.java | 118 ++ ...nagerForAgricultureSolutionProperties.java | 220 +++ ...anagerForAgricultureUpdateProperties.java} | 38 +- ...agerForAgricultureUpdateRequestModel.java} | 57 +- .../agrifood/models/DetailedInformation.java | 116 +- .../agrifood/models/Extension.java | 201 +- .../models/ExtensionInstallationRequest.java | 91 + .../models/ExtensionListResponse.java | 54 +- .../agrifood/models/Extensions.java | 146 +- .../agrifood/models/FarmBeatsExtension.java | 119 -- .../FarmBeatsExtensionListResponse.java | 66 - .../models/FarmBeatsListResponse.java | 66 - .../agrifood/models/FarmBeatsProperties.java | 52 - .../agrifood/models/Identity.java | 39 +- .../agrifood/models/KeyVaultProperties.java | 121 ++ .../models/MarketplaceOfferDetails.java | 80 + .../models/OAuthClientCredentials.java | 119 ++ .../agrifood/models/Operation.java | 16 +- .../agrifood/models/OperationDisplay.java | 29 +- .../agrifood/models/OperationListResult.java | 12 +- .../agrifood/models/OperationResults.java | 38 + .../agrifood/models/Operations.java | 16 +- .../agrifood/models/Origin.java | 25 +- .../agrifood/models/PrivateEndpoint.java | 18 +- .../models/PrivateEndpointConnection.java | 119 +- .../PrivateEndpointConnectionListResult.java | 48 +- ...teEndpointConnectionProvisioningState.java | 33 +- .../models/PrivateEndpointConnections.java | 81 +- ...rivateEndpointServiceConnectionStatus.java | 29 +- .../agrifood/models/PrivateLinkResource.java | 22 +- .../models/PrivateLinkResourceListResult.java | 48 +- .../agrifood/models/PrivateLinkResources.java | 51 +- .../PrivateLinkServiceConnectionState.java | 24 +- .../agrifood/models/ProvisioningState.java | 42 +- .../agrifood/models/PublicNetworkAccess.java | 27 +- .../agrifood/models/ResourceIdentityType.java | 18 +- .../agrifood/models/SensorIntegration.java | 41 +- .../agrifood/models/Solution.java | 196 ++ .../agrifood/models/SolutionListResponse.java | 117 ++ .../agrifood/models/SolutionProperties.java | 295 +++ .../agrifood/models/Solutions.java | 166 ++ .../models/SolutionsDiscoverabilities.java | 65 + .../agrifood/models/UnitSystemsInfo.java | 30 +- .../agrifood/models/package-info.java | 4 +- .../agrifood/package-info.java | 4 +- .../src/main/java/module-info.java | 12 +- .../proxy-config.json | 1 + .../reflect-config.json | 276 +++ ...ilabilityCheckNameAvailabilitySamples.java | 42 + .../DataConnectorsCreateOrUpdateSamples.java | 33 + .../DataConnectorsDeleteSamples.java | 24 + .../generated/DataConnectorsGetSamples.java | 24 + .../generated/DataConnectorsListSamples.java | 24 + ...gerForAgricultureExtensionsGetSamples.java | 24 + ...erForAgricultureExtensionsListSamples.java | 24 + ...ultureResourcesCreateOrUpdateSamples.java} | 21 +- ...rForAgricultureResourcesDeleteSamples.java | 25 + ...ureResourcesGetByResourceGroupSamples.java | 25 + ...reResourcesListByResourceGroupSamples.java | 24 + ...gerForAgricultureResourcesListSamples.java | 23 + ...rForAgricultureResourcesUpdateSamples.java | 43 + .../ExtensionsCreateOrUpdateSamples.java | 25 + .../generated/ExtensionsCreateSamples.java | 24 - .../generated/ExtensionsDeleteSamples.java | 16 +- .../generated/ExtensionsGetSamples.java | 16 +- ...istByDataManagerForAgricultureSamples.java | 25 + .../ExtensionsListByFarmBeatsSamples.java | 24 - .../generated/ExtensionsUpdateSamples.java | 24 - .../FarmBeatsExtensionsGetSamples.java | 22 - .../FarmBeatsExtensionsListSamples.java | 22 - .../FarmBeatsModelsDeleteSamples.java | 22 - ...mBeatsModelsGetByResourceGroupSamples.java | 24 - ...mBeatsModelsGetOperationResultSamples.java | 28 - ...BeatsModelsListByResourceGroupSamples.java | 22 - .../generated/FarmBeatsModelsListSamples.java | 22 - .../FarmBeatsModelsUpdateSamples.java | 68 - ...LocationsCheckNameAvailabilitySamples.java | 49 - .../generated/OperationResultsGetSamples.java | 24 + .../generated/OperationsListSamples.java | 12 +- ...pointConnectionsCreateOrUpdateSamples.java | 18 +- ...ivateEndpointConnectionsDeleteSamples.java | 16 +- .../PrivateEndpointConnectionsGetSamples.java | 17 +- ...pointConnectionsListByResourceSamples.java | 20 +- .../PrivateLinkResourcesGetSamples.java | 16 +- ...ateLinkResourcesListByResourceSamples.java | 14 +- .../SolutionsCreateOrUpdateSamples.java | 25 + .../generated/SolutionsDeleteSamples.java | 24 + .../SolutionsDiscoverabilityGetSamples.java | 22 + .../SolutionsDiscoverabilityListSamples.java | 22 + .../generated/SolutionsGetSamples.java | 24 + .../generated/SolutionsListSamples.java | 24 + .../ArmAsyncOperationInnerTests.java | 26 - .../CheckNameAvailabilityRequestTests.java | 31 - ...eckNameAvailabilityResponseInnerTests.java | 37 - .../generated/DetailedInformationTests.java | 50 - .../generated/ExtensionInnerTests.java | 26 - .../generated/ExtensionListResponseTests.java | 29 - .../generated/ExtensionPropertiesTests.java | 26 - .../ExtensionsListByFarmBeatsTests.java | 76 - .../FarmBeatsExtensionInnerTests.java | 26 - .../FarmBeatsExtensionListResponseTests.java | 30 - .../FarmBeatsExtensionPropertiesTests.java | 26 - .../FarmBeatsExtensionsListTests.java | 75 - .../generated/FarmBeatsInnerTests.java | 60 - .../generated/FarmBeatsListResponseTests.java | 78 - ...rmBeatsModelsListByResourceGroupTests.java | 75 - .../generated/FarmBeatsModelsListTests.java | 74 - .../FarmBeatsPropertiesInnerTests.java | 36 - .../FarmBeatsUpdatePropertiesTests.java | 36 - .../FarmBeatsUpdateRequestModelTests.java | 63 - .../agrifood/generated/IdentityTests.java | 29 - .../generated/OperationDisplayTests.java | 26 - .../generated/OperationInnerTests.java | 27 - .../generated/OperationListResultTests.java | 26 - .../generated/OperationsListTests.java | 65 - .../PrivateEndpointConnectionInnerTests.java | 47 - ...vateEndpointConnectionListResultTests.java | 35 - ...vateEndpointConnectionPropertiesTests.java | 47 - ...PrivateEndpointConnectionsDeleteTests.java | 62 - ...ndpointConnectionsListByResourceTests.java | 79 - .../generated/PrivateEndpointTests.java | 22 - .../PrivateLinkResourceInnerTests.java | 32 - .../PrivateLinkResourceListResultTests.java | 36 - .../PrivateLinkResourcePropertiesTests.java | 32 - ...ivateLinkResourcesListByResourceTests.java | 69 - ...rivateLinkServiceConnectionStateTests.java | 37 - .../generated/SensorIntegrationTests.java | 28 - .../generated/UnitSystemsInfoTests.java | 32 - 233 files changed, 14326 insertions(+), 8985 deletions(-) rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/{LocationsClient.java => CheckNameAvailabilitiesClient.java} (75%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/DataConnectorsClient.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/{FarmBeatsExtensionsClient.java => DataManagerForAgricultureExtensionsClient.java} (53%) rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/{FarmBeatsModelsClient.java => DataManagerForAgricultureResourcesClient.java} (56%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/OperationResultsClient.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsClient.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsDiscoverabilitiesClient.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataConnectorInner.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureExtensionInner.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/{FarmBeatsInner.java => DataManagerForAgricultureInner.java} (58%) rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/{FarmBeatsPropertiesInner.java => DataManagerForAgricultureProperties.java} (63%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureSolutionInner.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsExtensionInner.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionListResultInner.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceListResultInner.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/SolutionInner.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/{LocationsClientImpl.java => CheckNameAvailabilitiesClientImpl.java} (54%) rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/{LocationsImpl.java => CheckNameAvailabilitiesImpl.java} (58%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorsClientImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorsImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsClientImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesClientImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureSolutionImpl.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionImpl.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsClientImpl.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsImpl.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsImpl.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsClientImpl.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsImpl.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsPropertiesImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsClientImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateEndpointConnectionListResultImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourceListResultImpl.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/{Utils.java => ResourceManagerUtils.java} (79%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsClientImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesClientImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsImpl.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ApiKeyAuthCredentials.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ApiProperties.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ArmAsyncOperationError.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentials.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentialsKind.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/{Locations.java => CheckNameAvailabilities.java} (74%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnector.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorListResponse.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorProperties.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectors.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/{FarmBeats.java => DataManagerForAgriculture.java} (59%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtension.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensionListResponse.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/{fluent/models/FarmBeatsExtensionProperties.java => models/DataManagerForAgricultureExtensionProperties.java} (74%) rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/{FarmBeatsExtensions.java => DataManagerForAgricultureExtensions.java} (52%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureListResponse.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/{FarmBeatsModels.java => DataManagerForAgricultureResources.java} (59%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolution.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionListResponse.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionProperties.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/{FarmBeatsUpdateProperties.java => DataManagerForAgricultureUpdateProperties.java} (64%) rename sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/{FarmBeatsUpdateRequestModel.java => DataManagerForAgricultureUpdateRequestModel.java} (63%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ExtensionInstallationRequest.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtension.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtensionListResponse.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsListResponse.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsProperties.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/KeyVaultProperties.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/MarketplaceOfferDetails.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OAuthClientCredentials.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationResults.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solution.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionListResponse.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionProperties.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solutions.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionsDiscoverabilities.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/proxy-config.json create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/reflect-config.json create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityCheckNameAvailabilitySamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsCreateOrUpdateSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsDeleteSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsGetSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsListSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsGetSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsListSamples.java rename sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/{FarmBeatsModelsCreateOrUpdateSamples.java => DataManagerForAgricultureResourcesCreateOrUpdateSamples.java} (58%) create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesDeleteSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesGetByResourceGroupSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListByResourceGroupSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesUpdateSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateOrUpdateSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByDataManagerForAgricultureSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsUpdateSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsGetSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsListSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsDeleteSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsGetByResourceGroupSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsGetOperationResultSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListByResourceGroupSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsUpdateSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/LocationsCheckNameAvailabilitySamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationResultsGetSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsCreateOrUpdateSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDeleteSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityGetSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityListSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetSamples.java create mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsListSamples.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ArmAsyncOperationInnerTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityRequestTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityResponseInnerTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/DetailedInformationTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionInnerTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionListResponseTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionPropertiesTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionInnerTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionListResponseTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionPropertiesTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsListTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsInnerTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsListResponseTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListByResourceGroupTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsPropertiesInnerTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsUpdatePropertiesTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsUpdateRequestModelTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/IdentityTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationDisplayTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationInnerTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationListResultTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationsListTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionInnerTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionListResultTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionPropertiesTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceInnerTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceListResultTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcePropertiesTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkServiceConnectionStateTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SensorIntegrationTests.java delete mode 100644 sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/UnitSystemsInfoTests.java diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/CHANGELOG.md b/sdk/agrifood/azure-resourcemanager-agrifood/CHANGELOG.md index 7356ee0b3cb8..95fd0163567c 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.2 (Unreleased) +## 1.0.0-beta.1 (2024-04-24) + +- 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-2023-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/README.md b/sdk/agrifood/azure-resourcemanager-agrifood/README.md index 22161355b536..c9a4110c23f4 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-2023-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-agrifood - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,20 +83,25 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[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/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fagrifood%2Fazure-resourcemanager-agrifood%2FREADME.png) diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/SAMPLE.md b/sdk/agrifood/azure-resourcemanager-agrifood/SAMPLE.md index 50eb313368ea..3f6d32b39b05 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/SAMPLE.md +++ b/sdk/agrifood/azure-resourcemanager-agrifood/SAMPLE.md @@ -1,32 +1,41 @@ # Code snippets and samples -## Extensions +## CheckNameAvailability -- [Create](#extensions_create) -- [Delete](#extensions_delete) -- [Get](#extensions_get) -- [ListByFarmBeats](#extensions_listbyfarmbeats) -- [Update](#extensions_update) +- [CheckNameAvailability](#checknameavailability_checknameavailability) -## FarmBeatsExtensions +## DataConnectors -- [Get](#farmbeatsextensions_get) -- [List](#farmbeatsextensions_list) +- [CreateOrUpdate](#dataconnectors_createorupdate) +- [Delete](#dataconnectors_delete) +- [Get](#dataconnectors_get) +- [List](#dataconnectors_list) -## FarmBeatsModels +## DataManagerForAgricultureExtensions -- [CreateOrUpdate](#farmbeatsmodels_createorupdate) -- [Delete](#farmbeatsmodels_delete) -- [GetByResourceGroup](#farmbeatsmodels_getbyresourcegroup) -- [GetOperationResult](#farmbeatsmodels_getoperationresult) -- [List](#farmbeatsmodels_list) -- [ListByResourceGroup](#farmbeatsmodels_listbyresourcegroup) -- [Update](#farmbeatsmodels_update) +- [Get](#datamanagerforagricultureextensions_get) +- [List](#datamanagerforagricultureextensions_list) -## Locations +## DataManagerForAgricultureResources -- [CheckNameAvailability](#locations_checknameavailability) +- [CreateOrUpdate](#datamanagerforagricultureresources_createorupdate) +- [Delete](#datamanagerforagricultureresources_delete) +- [GetByResourceGroup](#datamanagerforagricultureresources_getbyresourcegroup) +- [List](#datamanagerforagricultureresources_list) +- [ListByResourceGroup](#datamanagerforagricultureresources_listbyresourcegroup) +- [Update](#datamanagerforagricultureresources_update) + +## Extensions + +- [CreateOrUpdate](#extensions_createorupdate) +- [Delete](#extensions_delete) +- [Get](#extensions_get) +- [ListByDataManagerForAgriculture](#extensions_listbydatamanagerforagriculture) + +## OperationResults + +- [Get](#operationresults_get) ## Operations @@ -43,189 +52,236 @@ - [Get](#privatelinkresources_get) - [ListByResource](#privatelinkresources_listbyresource) -### Extensions_Create + +## Solutions + +- [CreateOrUpdate](#solutions_createorupdate) +- [Delete](#solutions_delete) +- [Get](#solutions_get) +- [List](#solutions_list) + +## SolutionsDiscoverability + +- [Get](#solutionsdiscoverability_get) +- [List](#solutionsdiscoverability_list) +### CheckNameAvailability_CheckNameAvailability ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; + +/** + * Samples for CheckNameAvailability CheckNameAvailability. + */ +public final class CheckNameAvailabilityCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/CheckNameAvailability_CheckNameAvailability_AlreadyExists.json + */ + /** + * Sample code: CheckNameAvailability_CheckNameAvailability_AlreadyExists. + * + * @param manager Entry point to AgriFoodManager. + */ + 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); + } -/** Samples for Extensions Create. */ -public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/CheckNameAvailability_CheckNameAvailability_Available.json */ /** - * Sample code: Extensions_Create. - * + * Sample code: CheckNameAvailability_CheckNameAvailability_Available. + * * @param manager Entry point to AgriFoodManager. */ - public static void extensionsCreate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .extensions() - .createWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", Context.NONE); + 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); } } ``` -### Extensions_Delete +### DataConnectors_CreateOrUpdate ```java -import com.azure.core.util.Context; - -/** Samples for Extensions Delete. */ -public final class ExtensionsDeleteSamples { +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/2021-09-01-preview/examples/Extensions_Delete.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/DataConnectors_CreateOrUpdate.json */ /** - * Sample code: Extensions_Delete. - * + * Sample code: DataConnectors_CreateOrUpdate. + * * @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", Context.NONE); + 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_Get +### DataConnectors_Delete ```java -import com.azure.core.util.Context; - -/** Samples for Extensions Get. */ -public final class ExtensionsGetSamples { +/** + * Samples for DataConnectors Delete. + */ +public final class DataConnectorsDeleteSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Get.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/DataConnectors_Delete.json */ /** - * Sample code: Extensions_Get. - * + * Sample code: DataConnectors_Delete. + * * @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", Context.NONE); + 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_ListByFarmBeats +### DataConnectors_Get ```java -import com.azure.core.util.Context; - -/** Samples for Extensions ListByFarmBeats. */ -public final class ExtensionsListByFarmBeatsSamples { +/** + * Samples for DataConnectors Get. + */ +public final class DataConnectorsGetSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_ListByFarmBeats.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/DataConnectors_Get.json */ /** - * Sample code: Extensions_ListByFarmBeats. - * + * Sample code: DataConnectors_Get. + * * @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, Context.NONE); + 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_Update +### DataConnectors_List ```java -import com.azure.core.util.Context; - -/** Samples for Extensions Update. */ -public final class ExtensionsUpdateSamples { +/** + * Samples for DataConnectors List. + */ +public final class DataConnectorsListSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/DataConnectors_List.json */ /** - * Sample code: Extensions_Update. - * + * Sample code: DataConnectors_List. + * * @param manager Entry point to AgriFoodManager. */ - public static void extensionsUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .extensions() - .updateWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", Context.NONE); + 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 -import com.azure.core.util.Context; - -/** Samples for FarmBeatsExtensions Get. */ -public final class FarmBeatsExtensionsGetSamples { +/** + * Samples for DataManagerForAgricultureExtensions Get. + */ +public final class DataManagerForAgricultureExtensionsGetSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_Get.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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", 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 -import com.azure.core.util.Context; -/** Samples for FarmBeatsExtensions List. */ -public final class FarmBeatsExtensionsListSamples { +/** + * Samples for DataManagerForAgricultureExtensions List. + */ +public final class DataManagerForAgricultureExtensionsListSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsExtensions_List.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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, 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. */ -public final class FarmBeatsModelsCreateOrUpdateSamples { +/** + * Samples for DataManagerForAgricultureResources CreateOrUpdate. + */ +public final class DataManagerForAgricultureResourcesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_CreateOrUpdate.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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") - .withTags(mapOf("key1", "value1", "key2", "value2")) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -239,230 +295,255 @@ public final class FarmBeatsModelsCreateOrUpdateSamples { } ``` -### FarmBeatsModels_Delete +### DataManagerForAgricultureResources_Delete ```java -import com.azure.core.util.Context; - -/** Samples for FarmBeatsModels Delete. */ -public final class FarmBeatsModelsDeleteSamples { +/** + * Samples for DataManagerForAgricultureResources Delete. + */ +public final class DataManagerForAgricultureResourcesDeleteSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Delete.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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().deleteWithResponse("examples-rg", "examples-farmBeatsResourceName", Context.NONE); + 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 -import com.azure.core.util.Context; - -/** Samples for FarmBeatsModels GetByResourceGroup. */ -public final class FarmBeatsModelsGetByResourceGroupSamples { +/** + * Samples for DataManagerForAgricultureResources GetByResourceGroup. + */ +public final class DataManagerForAgricultureResourcesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Get.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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() - .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", Context.NONE); + public static void + dataManagerForAgricultureResourcesGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources() + .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", + com.azure.core.util.Context.NONE); } } ``` -### FarmBeatsModels_GetOperationResult +### DataManagerForAgricultureResources_List ```java -import com.azure.core.util.Context; - -/** Samples for FarmBeatsModels GetOperationResult. */ -public final class FarmBeatsModelsGetOperationResultSamples { +/** + * Samples for DataManagerForAgricultureResources List. + */ +public final class DataManagerForAgricultureResourcesListSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_GetOperationResult.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/DataManagerForAgricultureResources_ListBySubscription.json */ /** - * Sample code: FarmBeatsModels_GetOperationResult. - * + * Sample code: DataManagerForAgricultureResources_ListBySubscription. + * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsGetOperationResult(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .farmBeatsModels() - .getOperationResultWithResponse( - "examples-rg", - "examples-farmBeatsResourceName", - "resource-provisioning-id-farmBeatsResourceName", - Context.NONE); + public static void dataManagerForAgricultureResourcesListBySubscription( + com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.dataManagerForAgricultureResources().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### FarmBeatsModels_List +### DataManagerForAgricultureResources_ListByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for FarmBeatsModels List. */ -public final class FarmBeatsModelsListSamples { +/** + * Samples for DataManagerForAgricultureResources ListByResourceGroup. + */ +public final class DataManagerForAgricultureResourcesListByResourceGroupSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListBySubscription.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/DataManagerForAgricultureResources_ListByResourceGroup.json */ /** - * Sample code: FarmBeatsModels_ListBySubscription. - * + * Sample code: DataManagerForAgricultureResources_ListByResourceGroup. + * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsListBySubscription(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels().list(null, null, 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_ListByResourceGroup +### DataManagerForAgricultureResources_Update ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgriculture; +import java.util.HashMap; +import java.util.Map; -/** Samples for FarmBeatsModels ListByResourceGroup. */ -public final class FarmBeatsModelsListByResourceGroupSamples { +/** + * Samples for DataManagerForAgricultureResources Update. + */ +public final class DataManagerForAgricultureResourcesUpdateSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_ListByResourceGroup.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/DataManagerForAgricultureResources_Update.json */ /** - * Sample code: FarmBeatsModels_ListByResourceGroup. - * + * Sample code: DataManagerForAgricultureResources_Update. + * * @param manager Entry point to AgriFoodManager. */ - public static void farmBeatsModelsListByResourceGroup(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels().listByResourceGroup("examples-rg", null, null, Context.NONE); + 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; } } ``` -### FarmBeatsModels_Update +### Extensions_CreateOrUpdate ```java -import com.azure.core.util.Context; -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 { +/** + * Samples for Extensions CreateOrUpdate. + */ +public final class ExtensionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Update.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Extensions_CreateOrUpdate.json */ /** - * Sample code: FarmBeatsModels_Update. - * + * Sample code: Extensions_CreateOrUpdate. + * * @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", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply(); + 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 Extensions Delete. + */ +public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_UpdateWithSensor.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Extensions_Delete.json */ /** - * Sample code: FarmBeatsModels_UpdateWithSensor. - * + * Sample code: Extensions_Delete. + * * @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", Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("key1", "value1", "key2", "value2")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties( - new FarmBeatsUpdateProperties().withSensorIntegration(new SensorIntegration().withEnabled("True"))) - .apply(); + 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); } +} +``` - @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; +### Extensions_Get + +```java +/** + * Samples for Extensions Get. + */ +public final class ExtensionsGetSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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); } } ``` -### Locations_CheckNameAvailability +### Extensions_ListByDataManagerForAgriculture ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; -/** Samples for Locations CheckNameAvailability. */ -public final class LocationsCheckNameAvailabilitySamples { +/** + * Samples for Extensions ListByDataManagerForAgriculture. + */ +public final class ExtensionsListByDataManagerForAgricultureSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_Available.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Extensions_ListByDataManagerForAgriculture.json */ /** - * Sample code: Locations_CheckNameAvailability_Available. - * + * Sample code: Extensions_ListByDataManagerForAgriculture. + * * @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"), - Context.NONE); + 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); } +} +``` + +### OperationResults_Get +```java +/** + * Samples for OperationResults Get. + */ +public final class OperationResultsGetSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_AlreadyExists.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/OperationResults_Get.json */ /** - * Sample code: Locations_CheckNameAvailability_AlreadyExists. - * + * Sample code: OperationResults_Get. + * * @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"), - Context.NONE); + public static void operationResultsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.operationResults() + .getWithResponse("westus", "resource-provisioning-id-farmBeatsResourceName", + com.azure.core.util.Context.NONE); } } ``` @@ -470,20 +551,20 @@ public final class LocationsCheckNameAvailabilitySamples { ### Operations_List ```java -import com.azure.core.util.Context; - -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Operations_List.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Operations_List.json */ /** * Sample code: Operations_List. - * + * * @param manager Entry point to AgriFoodManager. */ public static void operationsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -494,25 +575,25 @@ public final class OperationsListSamples { import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_CreateOrUpdate.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateEndpointConnections_CreateOrUpdate.json */ /** * Sample code: PrivateEndpointConnections_CreateOrUpdate. - * + * * @param manager Entry point to AgriFoodManager. */ - public static void privateEndpointConnectionsCreateOrUpdate( - com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateEndpointConnections() + public static void + privateEndpointConnectionsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.privateEndpointConnections() .define("privateEndpointConnectionName") .withExistingFarmBeat("examples-rg", "examples-farmbeatsResourceName") .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) .withDescription("Approved by johndoe@contoso.com")) .create(); } @@ -522,22 +603,22 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { ### PrivateEndpointConnections_Delete ```java -import com.azure.core.util.Context; - -/** Samples for PrivateEndpointConnections Delete. */ +/** + * Samples for PrivateEndpointConnections Delete. + */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Delete.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateEndpointConnections_Delete.json */ /** * Sample code: PrivateEndpointConnections_Delete. - * + * * @param manager Entry point to AgriFoodManager. */ public static void privateEndpointConnectionsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateEndpointConnections() - .delete("examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", Context.NONE); + manager.privateEndpointConnections() + .delete("examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", + com.azure.core.util.Context.NONE); } } ``` @@ -545,23 +626,22 @@ public final class PrivateEndpointConnectionsDeleteSamples { ### PrivateEndpointConnections_Get ```java -import com.azure.core.util.Context; - -/** Samples for PrivateEndpointConnections Get. */ +/** + * Samples for PrivateEndpointConnections Get. + */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Get.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateEndpointConnections_Get.json */ /** * Sample code: PrivateEndpointConnections_Get. - * + * * @param manager Entry point to AgriFoodManager. */ public static void privateEndpointConnectionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateEndpointConnections() - .getWithResponse( - "examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", Context.NONE); + manager.privateEndpointConnections() + .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", + com.azure.core.util.Context.NONE); } } ``` @@ -569,23 +649,23 @@ public final class PrivateEndpointConnectionsGetSamples { ### PrivateEndpointConnections_ListByResource ```java -import com.azure.core.util.Context; - -/** Samples for PrivateEndpointConnections ListByResource. */ +/** + * Samples for PrivateEndpointConnections ListByResource. + */ public final class PrivateEndpointConnectionsListByResourceSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_ListByResource.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateEndpointConnections_ListByResource.json */ /** * Sample code: PrivateEndpointConnections_ListByResource. - * + * * @param manager Entry point to AgriFoodManager. */ - public static void privateEndpointConnectionsListByResource( - com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateEndpointConnections() - .listByResource("examples-rg", "examples-farmbeatsResourceName", Context.NONE); + public static void + privateEndpointConnectionsListByResource(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.privateEndpointConnections() + .listByResourceWithResponse("examples-rg", "examples-farmbeatsResourceName", + com.azure.core.util.Context.NONE); } } ``` @@ -593,22 +673,22 @@ public final class PrivateEndpointConnectionsListByResourceSamples { ### PrivateLinkResources_Get ```java -import com.azure.core.util.Context; - -/** Samples for PrivateLinkResources Get. */ +/** + * Samples for PrivateLinkResources Get. + */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_Get.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateLinkResources_Get.json */ /** * Sample code: PrivateLinkResources_Get. - * + * * @param manager Entry point to AgriFoodManager. */ public static void privateLinkResourcesGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateLinkResources() - .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "farmbeats", Context.NONE); + manager.privateLinkResources() + .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "farmbeats", + com.azure.core.util.Context.NONE); } } ``` @@ -616,20 +696,159 @@ public final class PrivateLinkResourcesGetSamples { ### PrivateLinkResources_ListByResource ```java -import com.azure.core.util.Context; - -/** Samples for PrivateLinkResources ListByResource. */ +/** + * Samples for PrivateLinkResources ListByResource. + */ public final class PrivateLinkResourcesListByResourceSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_ListByResource.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateLinkResources_ListByResource.json */ /** * Sample code: PrivateLinkResources_ListByResource. - * + * * @param manager Entry point to AgriFoodManager. */ public static void privateLinkResourcesListByResource(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.privateLinkResources().listByResource("examples-rg", "examples-farmbeatsResourceName", Context.NONE); + manager.privateLinkResources() + .listByResourceWithResponse("examples-rg", "examples-farmbeatsResourceName", + com.azure.core.util.Context.NONE); + } +} +``` + +### Solutions_CreateOrUpdate + +```java +/** + * Samples for Solutions CreateOrUpdate. + */ +public final class SolutionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Solutions_CreateOrUpdate.json + */ + /** + * Sample code: Solutions_CreateOrUpdate. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutions() + .define("abc.partner") + .withExistingFarmBeat("examples-rg", "examples-farmbeatsResourceName") + .create(); + } +} +``` + +### Solutions_Delete + +```java +/** + * Samples for Solutions Delete. + */ +public final class SolutionsDeleteSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Solutions_Delete.json + */ + /** + * Sample code: Solutions_Delete. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutions() + .deleteWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.solution", + com.azure.core.util.Context.NONE); + } +} +``` + +### Solutions_Get + +```java +/** + * Samples for Solutions Get. + */ +public final class SolutionsGetSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Solutions_Get.json + */ + /** + * Sample code: Solutions_Get. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutions() + .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.solution", + com.azure.core.util.Context.NONE); + } +} +``` + +### Solutions_List + +```java + +/** + * Samples for Solutions List. + */ +public final class SolutionsListSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Solutions_List.json + */ + /** + * Sample code: Solutions_List. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutions() + .list("examples-rg", "examples-farmbeatsResourceName", null, null, null, null, null, null, null, null, null, + null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### SolutionsDiscoverability_Get + +```java +/** + * Samples for SolutionsDiscoverability Get. + */ +public final class SolutionsDiscoverabilityGetSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/SolutionsDiscoverability_Get.json + */ + /** + * Sample code: SolutionsDiscoverability_Get. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsDiscoverabilityGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutionsDiscoverabilities().getWithResponse("bayerAgPowered.gdu", com.azure.core.util.Context.NONE); + } +} +``` + +### SolutionsDiscoverability_List + +```java + +/** + * Samples for SolutionsDiscoverability List. + */ +public final class SolutionsDiscoverabilityListSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/SolutionsDiscoverability_List.json + */ + /** + * Sample code: SolutionsDiscoverability_List. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsDiscoverabilityList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutionsDiscoverabilities().list(null, null, null, com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml b/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml index ea1f83d99cab..a93a2eb9f27b 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml +++ b/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,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-2023-06. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true @@ -75,8 +82,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy 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 c367847fb042..32992985d553 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 @@ -11,8 +11,8 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -25,20 +25,28 @@ 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; import com.azure.resourcemanager.agrifood.models.PrivateLinkResources; +import com.azure.resourcemanager.agrifood.models.Solutions; +import com.azure.resourcemanager.agrifood.models.SolutionsDiscoverabilities; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -46,15 +54,22 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to AgriFoodManager. APIs documentation for Azure AgFoodPlatform Resource Provider Service. */ +/** + * Entry point to AgriFoodManager. + * APIs documentation for Microsoft Azure Data Manager for Agriculture Service. + */ public final class AgriFoodManager { - private Extensions extensions; + private CheckNameAvailabilities checkNameAvailabilities; - private FarmBeatsExtensions farmBeatsExtensions; + private DataConnectors dataConnectors; - private FarmBeatsModels farmBeatsModels; + private DataManagerForAgricultureExtensions dataManagerForAgricultureExtensions; - private Locations locations; + private DataManagerForAgricultureResources dataManagerForAgricultureResources; + + private OperationResults operationResults; + + private Extensions extensions; private Operations operations; @@ -62,23 +77,25 @@ public final class AgriFoodManager { private PrivateLinkResources privateLinkResources; + private Solutions solutions; + + private SolutionsDiscoverabilities solutionsDiscoverabilities; + private final AgriFoodManagementClient clientObject; private AgriFoodManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new AgriFoodManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new AgriFoodManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** * Creates an instance of AgriFood service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the AgriFood service API instance. @@ -91,7 +108,7 @@ public static AgriFoodManager authenticate(TokenCredential credential, AzureProf /** * Creates an instance of AgriFood service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the AgriFood service API instance. @@ -104,14 +121,16 @@ public static AgriFoodManager authenticate(HttpPipeline httpPipeline, AzureProfi /** * Gets a Configurable instance that can be used to create AgriFoodManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new AgriFoodManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -183,8 +202,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -201,8 +220,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -222,15 +241,13 @@ public AgriFoodManager authenticate(TokenCredential credential, AzureProfile pro Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") + userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.agrifood") .append("/") .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") + userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ") .append(Configuration.getGlobalConfiguration().get("os.name")) @@ -255,86 +272,103 @@ public AgriFoodManager authenticate(TokenCredential credential, AzureProfile pro policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new AgriFoodManager(httpPipeline, profile, defaultPollInterval); } } /** - * Gets the resource collection API of Extensions. - * - * @return Resource collection API of Extensions. + * Gets the resource collection API of CheckNameAvailabilities. + * + * @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. - * - * @return Resource collection API of FarmBeatsExtensions. + * Gets the resource collection API of DataManagerForAgricultureExtensions. + * + * @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. - * - * @return Resource collection API of FarmBeatsModels. + * Gets the resource collection API of DataManagerForAgricultureResources. It manages DataManagerForAgriculture. + * + * @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; } /** - * Gets the resource collection API of Locations. - * - * @return Resource collection API of Locations. + * Gets the resource collection API of OperationResults. + * + * @return Resource collection API of OperationResults. */ - public Locations locations() { - if (this.locations == null) { - this.locations = new LocationsImpl(clientObject.getLocations(), this); + public OperationResults operationResults() { + if (this.operationResults == null) { + this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); } - return locations; + return operationResults; + } + + /** + * Gets the resource collection API of Extensions. It manages Extension. + * + * @return Resource collection API of Extensions. + */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(clientObject.getExtensions(), this); + } + return extensions; } /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -346,20 +380,20 @@ public Operations operations() { /** * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. - * + * * @return Resource collection API of PrivateEndpointConnections. */ public PrivateEndpointConnections privateEndpointConnections() { if (this.privateEndpointConnections == null) { - this.privateEndpointConnections = - new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); } return privateEndpointConnections; } /** * Gets the resource collection API of PrivateLinkResources. - * + * * @return Resource collection API of PrivateLinkResources. */ public PrivateLinkResources privateLinkResources() { @@ -370,8 +404,35 @@ public PrivateLinkResources privateLinkResources() { } /** - * @return Wrapped service client AgriFoodManagementClient providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. + * Gets the resource collection API of Solutions. It manages Solution. + * + * @return Resource collection API of Solutions. + */ + public Solutions solutions() { + if (this.solutions == null) { + this.solutions = new SolutionsImpl(clientObject.getSolutions(), this); + } + return solutions; + } + + /** + * Gets the resource collection API of SolutionsDiscoverabilities. + * + * @return Resource collection API of SolutionsDiscoverabilities. + */ + public SolutionsDiscoverabilities solutionsDiscoverabilities() { + if (this.solutionsDiscoverabilities == null) { + this.solutionsDiscoverabilities + = new SolutionsDiscoverabilitiesImpl(clientObject.getSolutionsDiscoverabilities(), this); + } + return solutionsDiscoverabilities; + } + + /** + * Gets wrapped service client AgriFoodManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client AgriFoodManagementClient. */ public AgriFoodManagementClient serviceClient() { return this.clientObject; 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 00b52b1d45c5..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 @@ -7,89 +7,119 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for AgriFoodManagementClient class. */ +/** + * The interface for AgriFoodManagementClient class. + */ public interface AgriFoodManagementClient { /** - * Gets The ID of the target subscription. - * + * Gets The ID of the target subscription. The value must be an UUID. + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** - * Gets the ExtensionsClient object to access its operations. - * - * @return the ExtensionsClient object. + * Gets the CheckNameAvailabilitiesClient object to access its operations. + * + * @return the CheckNameAvailabilitiesClient object. */ - ExtensionsClient getExtensions(); + CheckNameAvailabilitiesClient getCheckNameAvailabilities(); + + /** + * Gets the DataConnectorsClient object to access its operations. + * + * @return the DataConnectorsClient object. + */ + DataConnectorsClient getDataConnectors(); + + /** + * Gets the DataManagerForAgricultureExtensionsClient object to access its operations. + * + * @return the DataManagerForAgricultureExtensionsClient object. + */ + DataManagerForAgricultureExtensionsClient getDataManagerForAgricultureExtensions(); /** - * Gets the FarmBeatsExtensionsClient object to access its operations. - * - * @return the FarmBeatsExtensionsClient object. + * Gets the DataManagerForAgricultureResourcesClient object to access its operations. + * + * @return the DataManagerForAgricultureResourcesClient object. */ - FarmBeatsExtensionsClient getFarmBeatsExtensions(); + DataManagerForAgricultureResourcesClient getDataManagerForAgricultureResources(); /** - * Gets the FarmBeatsModelsClient object to access its operations. - * - * @return the FarmBeatsModelsClient object. + * Gets the OperationResultsClient object to access its operations. + * + * @return the OperationResultsClient object. */ - FarmBeatsModelsClient getFarmBeatsModels(); + OperationResultsClient getOperationResults(); /** - * Gets the LocationsClient object to access its operations. - * - * @return the LocationsClient object. + * Gets the ExtensionsClient object to access its operations. + * + * @return the ExtensionsClient object. */ - LocationsClient getLocations(); + ExtensionsClient getExtensions(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); /** * Gets the PrivateEndpointConnectionsClient object to access its operations. - * + * * @return the PrivateEndpointConnectionsClient object. */ PrivateEndpointConnectionsClient getPrivateEndpointConnections(); /** * Gets the PrivateLinkResourcesClient object to access its operations. - * + * * @return the PrivateLinkResourcesClient object. */ PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the SolutionsClient object to access its operations. + * + * @return the SolutionsClient object. + */ + SolutionsClient getSolutions(); + + /** + * Gets the SolutionsDiscoverabilitiesClient object to access its operations. + * + * @return the SolutionsDiscoverabilitiesClient object. + */ + SolutionsDiscoverabilitiesClient getSolutionsDiscoverabilities(); } 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 75% 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 a86bbfbb430e..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 @@ -11,31 +11,33 @@ import com.azure.resourcemanager.agrifood.fluent.models.CheckNameAvailabilityResponseInner; import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; -/** An instance of this class provides access to all the operations defined in LocationsClient. */ -public interface LocationsClient { +/** + * An instance of this class provides access to all the operations defined in CheckNameAvailabilitiesClient. + */ +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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the check availability result. + * @return the check availability result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResponseInner checkNameAvailability(CheckNameAvailabilityRequest body); + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context); /** * Checks the name availability of the resource with requested resource name. - * - * @param body NameAvailabilityRequest object. - * @param context The context to associate with this operation. + * + * @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 along with {@link Response}. + * @return the check availability result. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityRequest body, Context context); + 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 53% 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 7e94f2f52d11..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,66 +9,66 @@ 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. */ -public interface FarmBeatsExtensionsClient { +/** + * An instance of this class provides access to all the operations defined in DataManagerForAgricultureExtensionsClient. + */ +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. - * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. + * Get list of Data Manager For Agriculture extension. + * + * @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). Minimum = 10, Maximum = 1000, Default value = 50. + * @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 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, - 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. - * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * Get Data Manager For Agriculture extension. + * + * @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. + * @return data Manager For Agriculture extension along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - FarmBeatsExtensionInner get(String farmBeatsExtensionId); + Response getWithResponse(String dataManagerForAgricultureExtensionId, + Context context); /** - * Get farmBeats extension. - * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. - * @param context The context to associate with this operation. + * Get Data Manager For Agriculture extension. + * + * @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 along with {@link Response}. + * @return data Manager For Agriculture extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String farmBeatsExtensionId, Context context); + 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 56% 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 beee985eef68..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,241 +11,219 @@ 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.ArmAsyncOperationInner; -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. */ -public interface FarmBeatsModelsClient { +/** + * An instance of this class provides access to all the operations defined in DataManagerForAgricultureResourcesClient. + */ +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. + * @return dataManagerForAgriculture resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - FarmBeatsInner getByResourceGroup(String resourceGroupName, String farmBeatsResourceName); + 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 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 farmBeats resource along with {@link Response}. + * @return dataManagerForAgriculture resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String farmBeatsResourceName, Context context); + 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. + * @return data Manager For Agriculture ARM Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - FarmBeatsInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, FarmBeatsInner body); + 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 context The context to associate with this operation. + * @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 along with {@link Response}. + * @return data Manager For Agriculture ARM Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsInner body, Context context); + 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String farmBeatsResourceName); + 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 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, Context context); + 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. * @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}. + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Lists the FarmBeats instances for a subscription. - * - * @param maxPageSize Maximum number of items needed (inclusive). Minimum = 10, Maximum = 1000, Default value = 50. + * Lists the DataManagerForAgriculture instances for a subscription. + * + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. * @param skipToken Skip 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}. + * 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. * @throws com.azure.core.management.exception.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}. + * 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). Minimum = 10, Maximum = 1000, Default value = 50. + * @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}. + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, Integer maxPageSize, String skipToken, Context context); - - /** - * Get operationResults for a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param operationResultsId The operation results 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 operationResults for a FarmBeats resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArmAsyncOperationInner getOperationResult( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId); - - /** - * Get operationResults for a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param operationResultsId The operation results 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 operationResults for a FarmBeats resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getOperationResultWithResponse( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId, 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 98635606463e..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 @@ -10,30 +10,21 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.agrifood.fluent.models.ExtensionInner; +import com.azure.resourcemanager.agrifood.models.ExtensionInstallationRequest; import java.util.List; -/** An instance of this class provides access to all the operations defined in ExtensionsClient. */ +/** + * An instance of this class provides access to all the operations defined in ExtensionsClient. + */ public interface ExtensionsClient { /** - * Install extension. - * + * 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 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 extension resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner create(String resourceGroupName, String farmBeatsResourceName, String extensionId); - - /** - * Install 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 requestBody Extension 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. @@ -41,28 +32,31 @@ public interface ExtensionsClient { * @return extension resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId, ExtensionInstallationRequest requestBody, + Context context); /** - * Get installed extension details by extension id. - * + * 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return installed extension details by extension id. + * @return extension resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner get(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. @@ -71,89 +65,75 @@ Response createWithResponse( * @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); /** - * Upgrade to latest extension. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats 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 extension resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner update(String resourceGroupName, String farmBeatsResourceName, String extensionId); - - /** - * Upgrade to latest extension. - * + * 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. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extension resource along with {@link Response}. + * @return installed extension details by extension id. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context); + 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. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String farmBeatsResourceName, String extensionId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context); + 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). Minimum = 10, Maximum = 1000, Default value = 50. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. * @param skipToken Skip token for getting next set of results. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -162,12 +142,7 @@ Response deleteWithResponse( * @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 new file mode 100644 index 000000000000..8251f61a5a69 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/OperationResultsClient.java @@ -0,0 +1,43 @@ +// 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.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.agrifood.fluent.models.ArmAsyncOperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationResultsClient. + */ +public interface OperationResultsClient { + /** + * Get operationResults for a Data Manager For Agriculture resource. + * + * @param locations Location. + * @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 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 Data Manager For Agriculture resource. + * + * @param locations Location. + * @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 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/OperationsClient.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/OperationsClient.java index c7be5f99dad2..b4cd6b5789e8 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/OperationsClient.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/OperationsClient.java @@ -10,28 +10,30 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.agrifood.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * Lists the available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Lists the available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); 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 f1d874c24109..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,91 +6,96 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ 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. + * @return the private endpoint connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String farmBeatsResourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner body); + Response createOrUpdateWithResponse(String resourceGroupName, + 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 context The context to associate with this operation. + * @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 along with {@link Response}. + * @return the private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String farmBeatsResourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner body, - Context context); + 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. * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection object. + * @return private endpoint connection object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName); + 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. - * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection object along with {@link Response}. + * @return private endpoint connection object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, Context context); + 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 @@ Response getWithResponse( * @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( * @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( * @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 246da2a55dee..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,68 +6,76 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ 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. * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private link resource object. + * @return private link resource object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner get(String resourceGroupName, String farmBeatsResourceName, String subResourceName); + 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. - * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private link resource object along with {@link Response}. + * @return private link resource object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String farmBeatsResourceName, String subResourceName, Context context); + 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 new file mode 100644 index 000000000000..14580400797a --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsClient.java @@ -0,0 +1,154 @@ +// 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.SolutionInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined in SolutionsClient. + */ +public interface SolutionsClient { + /** + * Install Or Update Solution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 dataManagerForAgricultureResourceName, + String solutionId); + + /** + * Get installed Solution details by Solution id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 dataManagerForAgricultureResourceName, String solutionId); + + /** + * Uninstall Solution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 dataManagerForAgricultureResourceName, String solutionId); + + /** + * Get installed Solutions details. + * + * @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 installed Solutions details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName); + + /** + * Get installed Solutions details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionIds Installed Solution ids. + * @param ids Ids of the resource. + * @param names Names of the resource. + * @param propertyFilters Filters on key-value pairs within the Properties object. + * eg. "{testKey} eq {testValue}". + * @param statuses Statuses of the resource. + * @param minCreatedDateTime Minimum creation date of resource (inclusive). + * @param maxCreatedDateTime Maximum creation date of resource (inclusive). + * @param minLastModifiedDateTime Minimum last modified date of resource (inclusive). + * @param maxLastModifiedDateTime Maximum last modified date of resource (inclusive). + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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 installed Solutions details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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 new file mode 100644 index 000000000000..fac86472c868 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/SolutionsDiscoverabilitiesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.DataManagerForAgricultureSolutionInner; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined in SolutionsDiscoverabilitiesClient. + */ +public interface SolutionsDiscoverabilitiesClient { + /** + * 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 Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get list of Data Manager For Agriculture solutions. + * + * @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 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); + + /** + * Get Data Manager For Agriculture solution by id. + * + * @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 data Manager For Agriculture solution by id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String dataManagerForAgricultureSolutionId, + Context context); + + /** + * Get Data Manager For Agriculture solution by id. + * + * @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 data Manager For Agriculture solution by id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataManagerForAgricultureSolutionInner get(String dataManagerForAgricultureSolutionId); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ArmAsyncOperationInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ArmAsyncOperationInner.java index 71d60768ac31..47a6b870a96e 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ArmAsyncOperationInner.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/ArmAsyncOperationInner.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.agrifood.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.agrifood.models.ArmAsyncOperationError; import com.fasterxml.jackson.annotation.JsonProperty; /** - * Arm async operation class. Ref: - * https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/async-operations. + * Arm async operation class. + * Ref: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/async-operations. */ @Fluent public final class ArmAsyncOperationInner { @@ -19,9 +20,22 @@ public final class ArmAsyncOperationInner { @JsonProperty(value = "status") private String status; + /* + * Arm async operation error class. + * Ref: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format. + */ + @JsonProperty(value = "error") + private ArmAsyncOperationError error; + + /** + * Creates an instance of ArmAsyncOperationInner class. + */ + public ArmAsyncOperationInner() { + } + /** * Get the status property: Status of the async operation. - * + * * @return the status value. */ public String status() { @@ -30,7 +44,7 @@ public String status() { /** * Set the status property: Status of the async operation. - * + * * @param status the status value to set. * @return the ArmAsyncOperationInner object itself. */ @@ -39,11 +53,38 @@ public ArmAsyncOperationInner withStatus(String status) { return this; } + /** + * Get the error property: Arm async operation error class. + * Ref: + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format. + * + * @return the error value. + */ + public ArmAsyncOperationError error() { + return this.error; + } + + /** + * Set the error property: Arm async operation error class. + * Ref: + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format. + * + * @param error the error value to set. + * @return the ArmAsyncOperationInner object itself. + */ + public ArmAsyncOperationInner withError(ArmAsyncOperationError error) { + this.error = error; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (error() != null) { + error().validate(); + } } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/CheckNameAvailabilityResponseInner.java index 35c79bff3f32..8f62a3501b9a 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/CheckNameAvailabilityResponseInner.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/CheckNameAvailabilityResponseInner.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityReason; import com.fasterxml.jackson.annotation.JsonProperty; -/** The check availability result. */ +/** + * The check availability result. + */ @Fluent public final class CheckNameAvailabilityResponseInner { /* @@ -29,9 +31,15 @@ public final class CheckNameAvailabilityResponseInner { @JsonProperty(value = "message") private String message; + /** + * Creates an instance of CheckNameAvailabilityResponseInner class. + */ + public CheckNameAvailabilityResponseInner() { + } + /** * Get the nameAvailable property: Indicates if the resource name is available. - * + * * @return the nameAvailable value. */ public Boolean nameAvailable() { @@ -40,7 +48,7 @@ public Boolean nameAvailable() { /** * Set the nameAvailable property: Indicates if the resource name is available. - * + * * @param nameAvailable the nameAvailable value to set. * @return the CheckNameAvailabilityResponseInner object itself. */ @@ -51,7 +59,7 @@ public CheckNameAvailabilityResponseInner withNameAvailable(Boolean nameAvailabl /** * Get the reason property: The reason why the given name is not available. - * + * * @return the reason value. */ public CheckNameAvailabilityReason reason() { @@ -60,7 +68,7 @@ public CheckNameAvailabilityReason reason() { /** * Set the reason property: The reason why the given name is not available. - * + * * @param reason the reason value to set. * @return the CheckNameAvailabilityResponseInner object itself. */ @@ -71,7 +79,7 @@ public CheckNameAvailabilityResponseInner withReason(CheckNameAvailabilityReason /** * Get the message property: Detailed reason why the given name is available. - * + * * @return the message value. */ public String message() { @@ -80,7 +88,7 @@ public String message() { /** * Set the message property: Detailed reason why the given name is available. - * + * * @param message the message value to set. * @return the CheckNameAvailabilityResponseInner object itself. */ @@ -91,7 +99,7 @@ public CheckNameAvailabilityResponseInner withMessage(String message) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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..8ffb198d8cda --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataConnectorInner.java @@ -0,0 +1,96 @@ +// 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.resourcemanager.agrifood.models.DataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataConnector Model. + */ +@Fluent +public final class DataConnectorInner extends ProxyResource { + /* + * DataConnector Properties. + */ + @JsonProperty(value = "properties", required = true) + private DataConnectorProperties properties; + + /* + * The ETag value to implement optimistic concurrency. + */ + @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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; + } + + /** + * 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); +} 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..36643f5744ce --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureExtensionInner.java @@ -0,0 +1,76 @@ +// 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.resourcemanager.agrifood.models.DataManagerForAgricultureExtensionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataManagerForAgriculture extension resource. + */ +@Fluent +public final class DataManagerForAgricultureExtensionInner extends ProxyResource { + /* + * DataManagerForAgricultureExtension properties. + */ + @JsonProperty(value = "properties") + private DataManagerForAgricultureExtensionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} 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 58% 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 62c0263d9152..a3a7a42eb5c5 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 @@ -6,16 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.agrifood.models.Identity; import com.azure.resourcemanager.agrifood.models.ProvisioningState; import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; import com.azure.resourcemanager.agrifood.models.SensorIntegration; import com.fasterxml.jackson.annotation.JsonProperty; +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. */ @@ -23,14 +27,26 @@ public final class FarmBeatsInner extends Resource { private Identity identity; /* - * FarmBeats ARM Resource properties. + * Data Manager For Agriculture ARM Resource properties. */ @JsonProperty(value = "properties") - private FarmBeatsPropertiesInner innerProperties; + private DataManagerForAgricultureProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of DataManagerForAgricultureInner class. + */ + public DataManagerForAgricultureInner() { + } /** * Get the identity property: Identity for the resource. - * + * * @return the identity value. */ public Identity identity() { @@ -39,41 +55,54 @@ 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; } - /** {@inheritDoc} */ + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * {@inheritDoc} + */ @Override - public FarmBeatsInner withLocation(String location) { + public DataManagerForAgricultureInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@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. */ public String instanceUri() { @@ -81,8 +110,8 @@ 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. */ public ProvisioningState provisioningState() { @@ -91,7 +120,7 @@ public ProvisioningState provisioningState() { /** * Get the sensorIntegration property: Sensor integration request model. - * + * * @return the sensorIntegration value. */ public SensorIntegration sensorIntegration() { @@ -100,21 +129,22 @@ 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. */ public PublicNetworkAccess publicNetworkAccess() { @@ -122,31 +152,32 @@ 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(); } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 63% 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 fdb8c06f4a29..06f70e120249 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 @@ -9,18 +9,21 @@ import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; import com.azure.resourcemanager.agrifood.models.SensorIntegration; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; -/** FarmBeats ARM Resource properties. */ +/** + * Data Manager For Agriculture ARM Resource properties. + */ @Fluent -public final class FarmBeatsPropertiesInner { +public final class DataManagerForAgricultureProperties { /* - * Uri of the FarmBeats instance. + * Uri of the Data Manager For Agriculture instance. */ @JsonProperty(value = "instanceUri", access = JsonProperty.Access.WRITE_ONLY) private String instanceUri; /* - * FarmBeats instance provisioning state. + * Data Manager For Agriculture instance provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; @@ -32,20 +35,26 @@ public final class FarmBeatsPropertiesInner { 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. */ @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* - * The Private Endpoint Connection resource. + * Private endpoints. */ @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointConnectionInner privateEndpointConnections; + private List privateEndpointConnections; /** - * Get the instanceUri property: Uri of the FarmBeats instance. - * + * Creates an instance of DataManagerForAgricultureProperties class. + */ + public DataManagerForAgricultureProperties() { + } + + /** + * Get the instanceUri property: Uri of the Data Manager For Agriculture instance. + * * @return the instanceUri value. */ public String instanceUri() { @@ -53,8 +62,8 @@ 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. */ public ProvisioningState provisioningState() { @@ -63,7 +72,7 @@ public ProvisioningState provisioningState() { /** * Get the sensorIntegration property: Sensor integration request model. - * + * * @return the sensorIntegration value. */ public SensorIntegration sensorIntegration() { @@ -72,18 +81,19 @@ 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. */ public PublicNetworkAccess publicNetworkAccess() { @@ -91,28 +101,29 @@ 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; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -120,7 +131,7 @@ public void validate() { sensorIntegration().validate(); } if (privateEndpointConnections() != null) { - privateEndpointConnections().validate(); + privateEndpointConnections().forEach(e -> e.validate()); } } } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureSolutionInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureSolutionInner.java new file mode 100644 index 000000000000..780fe6170bf9 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/DataManagerForAgricultureSolutionInner.java @@ -0,0 +1,76 @@ +// 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.resourcemanager.agrifood.models.DataManagerForAgricultureSolutionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataManagerForAgriculture solution resource. + */ +@Fluent +public final class DataManagerForAgricultureSolutionInner extends ProxyResource { + /* + * DataManagerForAgricultureSolution properties. + */ + @JsonProperty(value = "properties") + private DataManagerForAgricultureSolutionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of DataManagerForAgricultureSolutionInner class. + */ + public DataManagerForAgricultureSolutionInner() { + } + + /** + * Get the properties property: DataManagerForAgricultureSolution properties. + * + * @return the properties value. + */ + public DataManagerForAgricultureSolutionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: DataManagerForAgricultureSolution properties. + * + * @param properties the properties value to set. + * @return the DataManagerForAgricultureSolutionInner object itself. + */ + public DataManagerForAgricultureSolutionInner + withProperties(DataManagerForAgricultureSolutionProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} 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 9958f6107edb..dde75dd09044 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 @@ -4,12 +4,17 @@ package com.azure.resourcemanager.agrifood.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.agrifood.models.ApiProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; -/** Extension resource. */ -@Fluent +/** + * Extension resource. + */ +@Immutable public final class ExtensionInner extends ProxyResource { /* * Extension resource properties. @@ -23,9 +28,21 @@ public final class ExtensionInner extends ProxyResource { @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of ExtensionInner class. + */ + public ExtensionInner() { + } + /** * Get the innerProperties property: Extension resource properties. - * + * * @return the innerProperties value. */ private ExtensionProperties innerProperties() { @@ -34,16 +51,25 @@ private ExtensionProperties innerProperties() { /** * 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 extensionId property: Extension Id. - * + * * @return the extensionId value. */ public String extensionId() { @@ -52,7 +78,7 @@ public String extensionId() { /** * Get the extensionCategory property: Extension category. e.g. weather/sensor/satellite. - * + * * @return the extensionCategory value. */ public String extensionCategory() { @@ -61,7 +87,7 @@ public String extensionCategory() { /** * Get the installedExtensionVersion property: Installed extension version. - * + * * @return the installedExtensionVersion value. */ public String installedExtensionVersion() { @@ -70,7 +96,7 @@ public String installedExtensionVersion() { /** * Get the extensionAuthLink property: Extension auth link. - * + * * @return the extensionAuthLink value. */ public String extensionAuthLink() { @@ -79,16 +105,25 @@ public String extensionAuthLink() { /** * Get the extensionApiDocsLink property: Extension api docs link. - * + * * @return the extensionApiDocsLink value. */ public String extensionApiDocsLink() { return this.innerProperties() == null ? null : this.innerProperties().extensionApiDocsLink(); } + /** + * Get the additionalApiProperties property: Additional Api Properties. + * + * @return the additionalApiProperties value. + */ + public Map additionalApiProperties() { + return this.innerProperties() == null ? null : this.innerProperties().additionalApiProperties(); + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 69fcb9a327be..825f731b9a10 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 @@ -5,9 +5,14 @@ package com.azure.resourcemanager.agrifood.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.agrifood.models.ApiProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; -/** Extension resource properties. */ +/** + * Extension resource properties. + */ @Immutable public final class ExtensionProperties { /* @@ -40,9 +45,22 @@ public final class ExtensionProperties { @JsonProperty(value = "extensionApiDocsLink", access = JsonProperty.Access.WRITE_ONLY) private String extensionApiDocsLink; + /* + * Additional Api Properties. + */ + @JsonProperty(value = "additionalApiProperties", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalApiProperties; + + /** + * Creates an instance of ExtensionProperties class. + */ + public ExtensionProperties() { + } + /** * Get the extensionId property: Extension Id. - * + * * @return the extensionId value. */ public String extensionId() { @@ -51,7 +69,7 @@ public String extensionId() { /** * Get the extensionCategory property: Extension category. e.g. weather/sensor/satellite. - * + * * @return the extensionCategory value. */ public String extensionCategory() { @@ -60,7 +78,7 @@ public String extensionCategory() { /** * Get the installedExtensionVersion property: Installed extension version. - * + * * @return the installedExtensionVersion value. */ public String installedExtensionVersion() { @@ -69,7 +87,7 @@ public String installedExtensionVersion() { /** * Get the extensionAuthLink property: Extension auth link. - * + * * @return the extensionAuthLink value. */ public String extensionAuthLink() { @@ -78,18 +96,34 @@ public String extensionAuthLink() { /** * Get the extensionApiDocsLink property: Extension api docs link. - * + * * @return the extensionApiDocsLink value. */ public String extensionApiDocsLink() { return this.extensionApiDocsLink; } + /** + * Get the additionalApiProperties property: Additional Api Properties. + * + * @return the additionalApiProperties value. + */ + public Map additionalApiProperties() { + return this.additionalApiProperties; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (additionalApiProperties() != null) { + additionalApiProperties().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } } } 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 1a6b25cf16f8..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/FarmBeatsExtensionInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.agrifood.models.DetailedInformation; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** FarmBeats extension resource. */ -@Fluent -public final class FarmBeatsExtensionInner extends ProxyResource { - /* - * FarmBeatsExtension properties. - */ - @JsonProperty(value = "properties") - private FarmBeatsExtensionProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** - * 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 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(); - } - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/OperationInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/OperationInner.java index 2383ed94899a..fa487b880e96 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/OperationInner.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/OperationInner.java @@ -12,21 +12,19 @@ /** * REST API Operation - * - *

Details of a REST API operation, returned from the Resource Provider Operations API. + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent public final class OperationInner { /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. */ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; @@ -38,8 +36,7 @@ public final class OperationInner { private OperationDisplay display; /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; @@ -50,10 +47,16 @@ public final class OperationInner { @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ public String name() { @@ -63,7 +66,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -72,7 +75,7 @@ public Boolean isDataAction() { /** * Get the display property: Localized display information for this particular operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -81,7 +84,7 @@ public OperationDisplay display() { /** * Set the display property: Localized display information for this particular operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -93,7 +96,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ public Origin origin() { @@ -103,7 +106,7 @@ public Origin origin() { /** * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ public ActionType actionType() { @@ -112,7 +115,7 @@ public ActionType actionType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionInner.java index 17660c73003e..f272304a401d 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionInner.java @@ -11,8 +11,11 @@ import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; -/** The Private Endpoint Connection resource. */ +/** + * The private endpoint connection resource. + */ @Fluent public final class PrivateEndpointConnectionInner extends ProxyResource { /* @@ -27,9 +30,15 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ + public PrivateEndpointConnectionInner() { + } + /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private PrivateEndpointConnectionProperties innerProperties() { @@ -38,7 +47,7 @@ private PrivateEndpointConnectionProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -46,8 +55,17 @@ public SystemData systemData() { } /** - * Get the privateEndpoint property: The resource of private end point. - * + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -55,8 +73,8 @@ public PrivateEndpoint privateEndpoint() { } /** - * Set the privateEndpoint property: The resource of private end point. - * + * Set the privateEndpoint property: The private endpoint resource. + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionInner object itself. */ @@ -71,7 +89,7 @@ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privat /** * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -81,12 +99,12 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionInner object itself. */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -96,7 +114,7 @@ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( /** * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -105,7 +123,7 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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..974d63a021c9 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionListResultInner.java @@ -0,0 +1,58 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of private endpoint connections associated with the specified resource. + */ +@Fluent +public final class PrivateEndpointConnectionListResultInner { + /* + * Array of private endpoint connections. + */ + @JsonProperty(value = "value") + 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()); + } + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionProperties.java index abb5495d8753..803a3113f42c 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateEndpointConnectionProperties.java @@ -10,12 +10,21 @@ import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; -/** Properties of the PrivateEndpointConnectProperties. */ +/** + * Properties of the private endpoint connection. + */ @Fluent public final class PrivateEndpointConnectionProperties { /* - * The resource of private end point. + * The group ids for the private endpoint resource. + */ + @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) + private List groupIds; + + /* + * The private endpoint resource. */ @JsonProperty(value = "privateEndpoint") private PrivateEndpoint privateEndpoint; @@ -33,8 +42,23 @@ public final class PrivateEndpointConnectionProperties { private PrivateEndpointConnectionProvisioningState provisioningState; /** - * Get the privateEndpoint property: The resource of private end point. - * + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -42,8 +66,8 @@ public PrivateEndpoint privateEndpoint() { } /** - * Set the privateEndpoint property: The resource of private end point. - * + * Set the privateEndpoint property: The private endpoint resource. + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionProperties object itself. */ @@ -55,7 +79,7 @@ public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint p /** * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -65,19 +89,19 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionProperties object itself. */ - public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; return this; } /** * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -86,7 +110,7 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -94,11 +118,9 @@ public void validate() { privateEndpoint().validate(); } if (privateLinkServiceConnectionState() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model" - + " PrivateEndpointConnectionProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); } else { privateLinkServiceConnectionState().validate(); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceInner.java index 78e2775fe9bd..7713f66f1e0f 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceInner.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A private link resource. */ +/** + * A private link resource. + */ @Fluent public final class PrivateLinkResourceInner extends ProxyResource { /* @@ -25,9 +27,15 @@ public final class PrivateLinkResourceInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** + * Creates an instance of PrivateLinkResourceInner class. + */ + public PrivateLinkResourceInner() { + } + /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private PrivateLinkResourceProperties innerProperties() { @@ -36,7 +44,7 @@ private PrivateLinkResourceProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -45,7 +53,7 @@ public SystemData systemData() { /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -54,7 +62,7 @@ public String groupId() { /** * Get the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -62,8 +70,8 @@ public List requiredMembers() { } /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -71,8 +79,8 @@ public List requiredZoneNames() { } /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the PrivateLinkResourceInner object itself. */ @@ -86,7 +94,7 @@ public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneN /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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..c7bb9e948ccf --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,58 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of private link resources. + */ +@Fluent +public final class PrivateLinkResourceListResultInner { + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + 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()); + } + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceProperties.java index 471b216902dd..62aad8ceecac 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/PrivateLinkResourceProperties.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Properties of a private link resource. */ +/** + * Properties of a private link resource. + */ @Fluent public final class PrivateLinkResourceProperties { /* @@ -24,14 +26,20 @@ public final class PrivateLinkResourceProperties { private List requiredMembers; /* - * The private link resource Private link DNS zone name. + * The private link resource private link DNS zone name. */ @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + public PrivateLinkResourceProperties() { + } + /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -40,7 +48,7 @@ public String groupId() { /** * Get the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -48,8 +56,8 @@ public List requiredMembers() { } /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -57,8 +65,8 @@ public List requiredZoneNames() { } /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the PrivateLinkResourceProperties object itself. */ @@ -69,7 +77,7 @@ public PrivateLinkResourceProperties withRequiredZoneNames(List required /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/SolutionInner.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/SolutionInner.java new file mode 100644 index 000000000000..ada5f3bdb592 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/fluent/models/SolutionInner.java @@ -0,0 +1,90 @@ +// 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.resourcemanager.agrifood.models.SolutionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Solution resource. + */ +@Fluent +public final class SolutionInner extends ProxyResource { + /* + * Solution resource properties. + */ + @JsonProperty(value = "properties") + private SolutionProperties properties; + + /* + * The ETag value to implement optimistic concurrency. + */ + @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of SolutionInner class. + */ + public SolutionInner() { + } + + /** + * 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 SolutionInner object itself. + */ + public SolutionInner withProperties(SolutionProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} 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 9506d1012900..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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for AgriFoodManagementClient. APIs documentation for Azure AgFoodPlatform - * Resource Provider Service. + * Package containing the inner data models for AgriFoodManagementClient. + * 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 0bc3fb4306b3..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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for AgriFoodManagementClient. APIs documentation for Azure AgFoodPlatform - * Resource Provider Service. + * Package containing the service clients for AgriFoodManagementClient. + * 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/AgriFoodManagementClientBuilder.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/AgriFoodManagementClientBuilder.java index 5588d38232fd..068ff9c69e95 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/AgriFoodManagementClientBuilder.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/AgriFoodManagementClientBuilder.java @@ -14,17 +14,19 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the AgriFoodManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {AgriFoodManagementClientImpl.class}) +/** + * A builder for creating a new instance of the AgriFoodManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { AgriFoodManagementClientImpl.class }) public final class AgriFoodManagementClientBuilder { /* - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The ID of the target subscription. - * + * Sets The ID of the target subscription. The value must be an UUID. + * * @param subscriptionId the subscriptionId value. * @return the AgriFoodManagementClientBuilder. */ @@ -40,7 +42,7 @@ public AgriFoodManagementClientBuilder subscriptionId(String subscriptionId) { /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the AgriFoodManagementClientBuilder. */ @@ -56,7 +58,7 @@ public AgriFoodManagementClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the AgriFoodManagementClientBuilder. */ @@ -72,7 +74,7 @@ public AgriFoodManagementClientBuilder environment(AzureEnvironment environment) /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the AgriFoodManagementClientBuilder. */ @@ -88,7 +90,7 @@ public AgriFoodManagementClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the AgriFoodManagementClientBuilder. */ @@ -104,7 +106,7 @@ public AgriFoodManagementClientBuilder defaultPollInterval(Duration defaultPollI /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the AgriFoodManagementClientBuilder. */ @@ -115,30 +117,22 @@ public AgriFoodManagementClientBuilder serializerAdapter(SerializerAdapter seria /** * Builds an instance of AgriFoodManagementClientImpl with the provided parameters. - * + * * @return an instance of AgriFoodManagementClientImpl. */ public AgriFoodManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - AgriFoodManagementClientImpl client = - new AgriFoodManagementClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + AgriFoodManagementClientImpl client = new AgriFoodManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } 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 f88545b443c4..44238fe71c60 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.agrifood.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,8 +13,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -23,13 +24,17 @@ 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; import com.azure.resourcemanager.agrifood.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.agrifood.fluent.SolutionsClient; +import com.azure.resourcemanager.agrifood.fluent.SolutionsDiscoverabilitiesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -39,200 +44,283 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the AgriFoodManagementClientImpl type. */ +/** + * Initializes a new instance of the AgriFoodManagementClientImpl type. + */ @ServiceClient(builder = AgriFoodManagementClientBuilder.class) public final class AgriFoodManagementClientImpl implements AgriFoodManagementClient { - /** The ID of the target subscription. */ + /** + * The ID of the target subscription. The value must be an UUID. + */ private final String subscriptionId; /** - * Gets The ID of the target subscription. - * + * Gets The ID of the target subscription. The value must be an UUID. + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The ExtensionsClient object to access its operations. */ - private final ExtensionsClient extensions; + /** + * The CheckNameAvailabilitiesClient object to access its operations. + */ + private final CheckNameAvailabilitiesClient checkNameAvailabilities; /** - * Gets the ExtensionsClient object to access its operations. - * - * @return the ExtensionsClient object. + * Gets the CheckNameAvailabilitiesClient object to access its operations. + * + * @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 DataManagerForAgricultureExtensionsClient object to access its operations. + */ + private final DataManagerForAgricultureExtensionsClient dataManagerForAgricultureExtensions; + + /** + * Gets the DataManagerForAgricultureExtensionsClient object to access its operations. + * + * @return the DataManagerForAgricultureExtensionsClient object. + */ + public DataManagerForAgricultureExtensionsClient getDataManagerForAgricultureExtensions() { + return this.dataManagerForAgricultureExtensions; } - /** The FarmBeatsExtensionsClient object to access its operations. */ - private final FarmBeatsExtensionsClient farmBeatsExtensions; + /** + * The DataManagerForAgricultureResourcesClient object to access its operations. + */ + private final DataManagerForAgricultureResourcesClient dataManagerForAgricultureResources; /** - * Gets the FarmBeatsExtensionsClient object to access its operations. - * - * @return the FarmBeatsExtensionsClient object. + * Gets the DataManagerForAgricultureResourcesClient object to access its operations. + * + * @return the DataManagerForAgricultureResourcesClient object. */ - public FarmBeatsExtensionsClient getFarmBeatsExtensions() { - return this.farmBeatsExtensions; + public DataManagerForAgricultureResourcesClient getDataManagerForAgricultureResources() { + return this.dataManagerForAgricultureResources; } - /** The FarmBeatsModelsClient object to access its operations. */ - private final FarmBeatsModelsClient farmBeatsModels; + /** + * The OperationResultsClient object to access its operations. + */ + private final OperationResultsClient operationResults; /** - * Gets the FarmBeatsModelsClient object to access its operations. - * - * @return the FarmBeatsModelsClient object. + * Gets the OperationResultsClient object to access its operations. + * + * @return the OperationResultsClient object. */ - public FarmBeatsModelsClient getFarmBeatsModels() { - return this.farmBeatsModels; + public OperationResultsClient getOperationResults() { + return this.operationResults; } - /** The LocationsClient object to access its operations. */ - private final LocationsClient locations; + /** + * The ExtensionsClient object to access its operations. + */ + private final ExtensionsClient extensions; /** - * Gets the LocationsClient object to access its operations. - * - * @return the LocationsClient object. + * Gets the ExtensionsClient object to access its operations. + * + * @return the ExtensionsClient object. */ - public LocationsClient getLocations() { - return this.locations; + public ExtensionsClient getExtensions() { + return this.extensions; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { return this.operations; } - /** The PrivateEndpointConnectionsClient object to access its operations. */ + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ private final PrivateEndpointConnectionsClient privateEndpointConnections; /** * Gets the PrivateEndpointConnectionsClient object to access its operations. - * + * * @return the PrivateEndpointConnectionsClient object. */ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { return this.privateEndpointConnections; } - /** The PrivateLinkResourcesClient object to access its operations. */ + /** + * The PrivateLinkResourcesClient object to access its operations. + */ private final PrivateLinkResourcesClient privateLinkResources; /** * Gets the PrivateLinkResourcesClient object to access its operations. - * + * * @return the PrivateLinkResourcesClient object. */ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } + /** + * The SolutionsClient object to access its operations. + */ + private final SolutionsClient solutions; + + /** + * Gets the SolutionsClient object to access its operations. + * + * @return the SolutionsClient object. + */ + public SolutionsClient getSolutions() { + return this.solutions; + } + + /** + * The SolutionsDiscoverabilitiesClient object to access its operations. + */ + private final SolutionsDiscoverabilitiesClient solutionsDiscoverabilities; + + /** + * Gets the SolutionsDiscoverabilitiesClient object to access its operations. + * + * @return the SolutionsDiscoverabilitiesClient object. + */ + public SolutionsDiscoverabilitiesClient getSolutionsDiscoverabilities() { + return this.solutionsDiscoverabilities; + } + /** * Initializes an instance of AgriFoodManagementClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ - AgriFoodManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + AgriFoodManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-09-01-preview"; + this.apiVersion = "2023-06-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.extensions = new ExtensionsClientImpl(this); - this.farmBeatsExtensions = new FarmBeatsExtensionsClientImpl(this); - this.farmBeatsModels = new FarmBeatsModelsClientImpl(this); - this.locations = new LocationsClientImpl(this); this.operations = new OperationsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.solutions = new SolutionsClientImpl(this); + this.solutionsDiscoverabilities = new SolutionsDiscoverabilitiesClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -241,7 +329,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -251,7 +339,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -261,26 +349,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -293,19 +370,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -346,7 +420,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ArmAsyncOperationImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ArmAsyncOperationImpl.java index 134b29e92947..3969140cc40d 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ArmAsyncOperationImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ArmAsyncOperationImpl.java @@ -6,14 +6,15 @@ import com.azure.resourcemanager.agrifood.fluent.models.ArmAsyncOperationInner; import com.azure.resourcemanager.agrifood.models.ArmAsyncOperation; +import com.azure.resourcemanager.agrifood.models.ArmAsyncOperationError; public final class ArmAsyncOperationImpl implements ArmAsyncOperation { private ArmAsyncOperationInner innerObject; private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - ArmAsyncOperationImpl( - ArmAsyncOperationInner innerObject, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + ArmAsyncOperationImpl(ArmAsyncOperationInner innerObject, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -22,6 +23,10 @@ public String status() { return this.innerModel().status(); } + public ArmAsyncOperationError error() { + return this.innerModel().error(); + } + public ArmAsyncOperationInner innerModel() { return this.innerObject; } 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 54% 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 f4e64389a921..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,98 +22,90 @@ 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. */ -public final class LocationsClientImpl implements LocationsClient { - /** The proxy service used to perform REST calls. */ - private final LocationsService service; +/** + * An instance of this class provides access to all the operations defined in CheckNameAvailabilitiesClient. + */ +public final class CheckNameAvailabilitiesClientImpl implements CheckNameAvailabilitiesClient { + /** + * The proxy service used to perform REST calls. + */ + private final CheckNameAvailabilitiesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ 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") - private interface LocationsService { - @Headers({"Content-Type: application/json"}) + public interface CheckNameAvailabilitiesService { + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/checkNameAvailability") - @ExpectedResponses({200}) + @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); + Mono> checkNameAvailability(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @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. * @return the check availability result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailabilityRequest body) { + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest nameAvailabilityRequest) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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)) + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + 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. @@ -121,78 +113,72 @@ private Mono> checkNameAvailability * @return the check availability result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailabilityRequest body, Context context) { + private Mono> + 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.")); + 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.")); + 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); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the check availability result. + * @return the check availability result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResponseInner checkNameAvailability(CheckNameAvailabilityRequest body) { - return checkNameAvailabilityAsync(body).block(); + public Response + 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 context The context to associate with this operation. + * + * @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 along with {@link Response}. + * @return the check availability result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityRequest body, Context context) { - return checkNameAvailabilityWithResponseAsync(body, context).block(); + 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 58% 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 938d5ee985c1..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,50 +8,47 @@ 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, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + public CheckNameAvailabilitiesImpl(CheckNameAvailabilitiesClient innerClient, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest body) { - CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(body); + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(nameAvailabilityRequest, context); if (inner != null) { - return new CheckNameAvailabilityResponseImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityRequest body, Context context) { - Response inner = - this.serviceClient().checkNameAvailabilityWithResponse(body, context); + public CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest nameAvailabilityRequest) { + CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(nameAvailabilityRequest); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); + return new CheckNameAvailabilityResponseImpl(inner, this.manager()); } else { return null; } } - 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/CheckNameAvailabilityResponseImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/CheckNameAvailabilityResponseImpl.java index 70c9391fa650..d7bdedc7dd04 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/CheckNameAvailabilityResponseImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/CheckNameAvailabilityResponseImpl.java @@ -13,8 +13,7 @@ public final class CheckNameAvailabilityResponseImpl implements CheckNameAvailab private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - CheckNameAvailabilityResponseImpl( - CheckNameAvailabilityResponseInner innerObject, + CheckNameAvailabilityResponseImpl(CheckNameAvailabilityResponseInner innerObject, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; 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..411a505d9d70 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataConnectorsClientImpl.java @@ -0,0 +1,808 @@ +// 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 + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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/DataManagerForAgricultureExtensionsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsClientImpl.java new file mode 100644 index 000000000000..f9da7802d58a --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureExtensionsClientImpl.java @@ -0,0 +1,456 @@ +// 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.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.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; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DataManagerForAgricultureExtensionsClient. + */ +public final class DataManagerForAgricultureExtensionsClientImpl implements DataManagerForAgricultureExtensionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DataManagerForAgricultureExtensionsService service; + + /** + * The service client containing this operation class. + */ + private final AgriFoodManagementClientImpl client; + + /** + * Initializes an instance of DataManagerForAgricultureExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataManagerForAgricultureExtensionsClientImpl(AgriFoodManagementClientImpl client) { + this.service = RestProxy.create(DataManagerForAgricultureExtensionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * 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 DataManagerForAgricultureExtensionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam(value = "farmBeatsExtensionIds", multipleQueryParams = true) List farmBeatsExtensionIds, + @QueryParam( + value = "farmBeatsExtensionNames", + multipleQueryParams = true) List farmBeatsExtensionNames, + @QueryParam(value = "extensionCategories", multipleQueryParams = true) List extensionCategories, + @QueryParam(value = "publisherIds", multipleQueryParams = true) List publisherIds, + @QueryParam("$maxPageSize") Integer maxPageSize, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions/{dataManagerForAgricultureExtensionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get list of Data Manager For Agriculture extension. + * + * @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). + * 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 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) { + 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"; + List farmBeatsExtensionIdsConverted = (farmBeatsExtensionIds == null) + ? new ArrayList<>() + : farmBeatsExtensionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List farmBeatsExtensionNamesConverted = (farmBeatsExtensionNames == null) + ? new ArrayList<>() + : farmBeatsExtensionNames.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List extensionCategoriesConverted = (extensionCategories == null) + ? new ArrayList<>() + : extensionCategories.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List publisherIdsConverted = (publisherIds == null) + ? new ArrayList<>() + : publisherIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext(context -> 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get list of Data Manager For Agriculture extension. + * + * @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). + * 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 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, Context context) { + 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"; + List farmBeatsExtensionIdsConverted = (farmBeatsExtensionIds == null) + ? new ArrayList<>() + : farmBeatsExtensionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List farmBeatsExtensionNamesConverted = (farmBeatsExtensionNames == null) + ? new ArrayList<>() + : farmBeatsExtensionNames.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List extensionCategoriesConverted = (extensionCategories == null) + ? new ArrayList<>() + : extensionCategories.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List publisherIdsConverted = (publisherIds == null) + ? new ArrayList<>() + : publisherIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return 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)); + } + + /** + * Get list of Data Manager For Agriculture extension. + * + * @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). + * 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 Data Manager For Agriculture extension as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(List farmBeatsExtensionIds, + List farmBeatsExtensionNames, List extensionCategories, List publisherIds, + Integer maxPageSize) { + return new PagedFlux<>(() -> listSinglePageAsync(farmBeatsExtensionIds, farmBeatsExtensionNames, + extensionCategories, publisherIds, maxPageSize), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 Data Manager For Agriculture extension as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final List farmBeatsExtensionIds = null; + final List farmBeatsExtensionNames = null; + final List extensionCategories = null; + final List publisherIds = null; + final Integer maxPageSize = null; + return new PagedFlux<>(() -> listSinglePageAsync(farmBeatsExtensionIds, farmBeatsExtensionNames, + extensionCategories, publisherIds, maxPageSize), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get list of Data Manager For Agriculture extension. + * + * @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). + * 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 Data Manager For Agriculture extension as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(List farmBeatsExtensionIds, + List farmBeatsExtensionNames, List extensionCategories, List publisherIds, + Integer maxPageSize, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(farmBeatsExtensionIds, farmBeatsExtensionNames, + extensionCategories, publisherIds, maxPageSize, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 Data Manager For Agriculture extension as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final List farmBeatsExtensionIds = null; + final List farmBeatsExtensionNames = null; + final List extensionCategories = null; + final List publisherIds = null; + final Integer maxPageSize = null; + return new PagedIterable<>( + listAsync(farmBeatsExtensionIds, farmBeatsExtensionNames, extensionCategories, publisherIds, maxPageSize)); + } + + /** + * Get list of Data Manager For Agriculture extension. + * + * @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). + * 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 Data Manager For Agriculture extension as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(List farmBeatsExtensionIds, + List farmBeatsExtensionNames, List extensionCategories, List publisherIds, + Integer maxPageSize, Context context) { + return new PagedIterable<>(listAsync(farmBeatsExtensionIds, farmBeatsExtensionNames, extensionCategories, + publisherIds, maxPageSize, context)); + } + + /** + * Get Data Manager For Agriculture extension. + * + * @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 data Manager For Agriculture extension along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 (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(), dataManagerForAgricultureExtensionId, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Data Manager For Agriculture extension. + * + * @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 data Manager For Agriculture extension along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 (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(), dataManagerForAgricultureExtensionId, this.client.getApiVersion(), + accept, context); + } + + /** + * Get Data Manager For Agriculture extension. + * + * @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 data Manager For Agriculture extension on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String dataManagerForAgricultureExtensionId) { + return getWithResponseAsync(dataManagerForAgricultureExtensionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Data Manager For Agriculture extension. + * + * @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 data Manager For Agriculture extension along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getWithResponse(String dataManagerForAgricultureExtensionId, Context context) { + return getWithResponseAsync(dataManagerForAgricultureExtensionId, context).block(); + } + + /** + * Get Data Manager For Agriculture extension. + * + * @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 data Manager For Agriculture extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerForAgricultureExtensionInner get(String dataManagerForAgricultureExtensionId) { + return getWithResponse(dataManagerForAgricultureExtensionId, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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/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/DataManagerForAgricultureImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureImpl.java new file mode 100644 index 000000000000..650e903cc7c4 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureImpl.java @@ -0,0 +1,238 @@ +// 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.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; +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 DataManagerForAgricultureImpl + implements DataManagerForAgriculture, DataManagerForAgriculture.Definition, DataManagerForAgriculture.Update { + private DataManagerForAgricultureInner 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 String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DataManagerForAgricultureInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String dataManagerForAgricultureResourceName; + + private DataManagerForAgricultureUpdateRequestModel updateRequest; + + public DataManagerForAgricultureImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DataManagerForAgriculture create() { + this.innerObject = serviceManager.serviceClient() + .getDataManagerForAgricultureResources() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public DataManagerForAgriculture create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDataManagerForAgricultureResources() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, this.innerModel(), + context) + .getValue(); + return this; + } + + DataManagerForAgricultureImpl(String name, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerObject = new DataManagerForAgricultureInner(); + this.serviceManager = serviceManager; + this.dataManagerForAgricultureResourceName = name; + } + + public DataManagerForAgricultureImpl update() { + this.updateRequest = new DataManagerForAgricultureUpdateRequestModel(); + return this; + } + + public DataManagerForAgriculture apply() { + this.innerObject = serviceManager.serviceClient() + .getDataManagerForAgricultureResources() + .update(resourceGroupName, dataManagerForAgricultureResourceName, updateRequest, Context.NONE); + return this; + } + + public DataManagerForAgriculture apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDataManagerForAgricultureResources() + .update(resourceGroupName, dataManagerForAgricultureResourceName, updateRequest, context); + return this; + } + + DataManagerForAgricultureImpl(DataManagerForAgricultureInner 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"); + } + + public DataManagerForAgriculture refresh() { + this.innerObject = serviceManager.serviceClient() + .getDataManagerForAgricultureResources() + .getByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE) + .getValue(); + return this; + } + + public DataManagerForAgriculture refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDataManagerForAgricultureResources() + .getByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, context) + .getValue(); + return this; + } + + public DataManagerForAgricultureImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DataManagerForAgricultureImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DataManagerForAgricultureImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateRequest.withTags(tags); + return this; + } + } + + public DataManagerForAgricultureImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateRequest.withIdentity(identity); + return this; + } + } + + public DataManagerForAgricultureImpl withSensorIntegration(SensorIntegration sensorIntegration) { + this.innerModel().withSensorIntegration(sensorIntegration); + return this; + } + + public DataManagerForAgricultureImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + public DataManagerForAgricultureImpl withProperties(DataManagerForAgricultureUpdateProperties properties) { + this.updateRequest.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesClientImpl.java new file mode 100644 index 000000000000..eace9757b46b --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureResourcesClientImpl.java @@ -0,0 +1,1230 @@ +// 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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +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 DataManagerForAgricultureResourcesClient. + */ +public final class DataManagerForAgricultureResourcesClientImpl implements DataManagerForAgricultureResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DataManagerForAgricultureResourcesService service; + + /** + * The service client containing this operation class. + */ + private final AgriFoodManagementClientImpl client; + + /** + * Initializes an instance of DataManagerForAgricultureResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataManagerForAgricultureResourcesClientImpl(AgriFoodManagementClientImpl client) { + this.service = RestProxy.create(DataManagerForAgricultureResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * 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 DataManagerForAgricultureResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @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/{dataManagerForAgricultureResourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @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/{dataManagerForAgricultureResourceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @QueryParam("api-version") String apiVersion, + @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/{dataManagerForAgricultureResourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @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, + @QueryParam("$maxPageSize") Integer maxPageSize, @QueryParam("$skipToken") String skipToken, + @PathParam("subscriptionId") String subscriptionId, @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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get DataManagerForAgriculture resource. + * + * @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 dataManagerForAgriculture resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + 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.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 DataManagerForAgriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 dataManagerForAgriculture resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + 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.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context); + } + + /** + * Get DataManagerForAgriculture resource. + * + * @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 dataManagerForAgriculture resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get DataManagerForAgriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 dataManagerForAgriculture resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, context) + .block(); + } + + /** + * Get DataManagerForAgriculture resource. + * + * @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 dataManagerForAgriculture resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerForAgricultureInner getByResourceGroup(String resourceGroupName, + String dataManagerForAgricultureResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE) + .getValue(); + } + + /** + * Create or update Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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 dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request) { + 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.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), request, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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 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.")); + } + 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.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, this.client.getApiVersion(), request, accept, context); + } + + /** + * Create or update Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, request) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, + context).block(); + } + + /** + * Create or update Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerForAgricultureInner createOrUpdate(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureInner request) { + return createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, request, + Context.NONE).getValue(); + } + + /** + * Update a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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 dataManagerForAgricultureResourceName, DataManagerForAgricultureUpdateRequestModel request) { + 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.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .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 Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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 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.")); + } + 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.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, this.client.getApiVersion(), request, accept, context); + } + + /** + * Update a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataManagerForAgricultureInner> beginUpdateAsync( + String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DataManagerForAgricultureInner.class, DataManagerForAgricultureInner.class, + context); + } + + /** + * Update a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataManagerForAgricultureInner> beginUpdate( + String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request) { + return this.beginUpdateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request).getSyncPoller(); + } + + /** + * Update a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataManagerForAgricultureInner> beginUpdate( + String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request, Context context) { + return this.beginUpdateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, context) + .getSyncPoller(); + } + + /** + * Update a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureUpdateRequestModel request) { + return beginUpdateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, DataManagerForAgricultureUpdateRequestModel request, + Context context) { + return beginUpdateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerForAgricultureInner update(String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request) { + return updateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request).block(); + } + + /** + * Update a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 data Manager For Agriculture ARM Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerForAgricultureInner update(String resourceGroupName, String dataManagerForAgricultureResourceName, + DataManagerForAgricultureUpdateRequestModel request, Context context) { + return updateAsync(resourceGroupName, dataManagerForAgricultureResourceName, request, context).block(); + } + + /** + * Delete a Data Manager For Agriculture resource. + * + * @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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + 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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + 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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a Data Manager For Agriculture resource. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dataManagerForAgricultureResourceName) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a Data Manager For Agriculture resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, context).block(); + } + + /** + * Delete a Data Manager For Agriculture resource. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName) { + deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, Context.NONE); + } + + /** + * Lists the DataManagerForAgriculture instances for a subscription. + * + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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(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.")); + } + final String accept = "application/json"; + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the DataManagerForAgriculture instances for a subscription. + * + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return 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)); + } + + /** + * Lists the DataManagerForAgriculture instances for a subscription. + * + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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(Integer maxPageSize, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(maxPageSize, skipToken), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * 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. + * @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() { + final Integer maxPageSize = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(maxPageSize, skipToken), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists the DataManagerForAgriculture instances for a subscription. + * + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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(Integer maxPageSize, String skipToken, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(maxPageSize, skipToken, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @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() { + final Integer maxPageSize = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(maxPageSize, skipToken)); + } + + /** + * Lists the DataManagerForAgriculture instances for a subscription. + * + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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(Integer maxPageSize, String skipToken, Context context) { + return new PagedIterable<>(listAsync(maxPageSize, skipToken, context)); + } + + /** + * 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). + * 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> + 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.")); + } + 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.")); + } + final String accept = "application/json"; + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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). + * 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> 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.")); + } + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return 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)); + } + + /** + * 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). + * 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 listByResourceGroupAsync(String resourceGroupName, + Integer maxPageSize, String skipToken) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, maxPageSize, skipToken), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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. + * @throws 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 listByResourceGroupAsync(String resourceGroupName) { + final Integer maxPageSize = null; + final String skipToken = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, maxPageSize, skipToken), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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). + * 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 listByResourceGroupAsync(String resourceGroupName, + Integer maxPageSize, String skipToken, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, maxPageSize, skipToken, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws 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 listByResourceGroup(String resourceGroupName) { + final Integer maxPageSize = null; + final String skipToken = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, maxPageSize, skipToken)); + } + + /** + * 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). + * 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 listByResourceGroup(String resourceGroupName, + Integer maxPageSize, String skipToken, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, maxPageSize, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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/DataManagerForAgricultureSolutionImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureSolutionImpl.java new file mode 100644 index 000000000000..f6c1ec66c874 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/DataManagerForAgricultureSolutionImpl.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.DataManagerForAgricultureSolutionInner; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureSolution; +import com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureSolutionProperties; + +public final class DataManagerForAgricultureSolutionImpl implements DataManagerForAgricultureSolution { + private DataManagerForAgricultureSolutionInner innerObject; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + DataManagerForAgricultureSolutionImpl(DataManagerForAgricultureSolutionInner 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 DataManagerForAgricultureSolutionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DataManagerForAgricultureSolutionInner 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/ExtensionImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ExtensionImpl.java index 1c28f880aa3a..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 @@ -4,19 +4,20 @@ 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.ExtensionInner; +import com.azure.resourcemanager.agrifood.models.ApiProperties; import com.azure.resourcemanager.agrifood.models.Extension; +import com.azure.resourcemanager.agrifood.models.ExtensionInstallationRequest; +import java.util.Collections; +import java.util.Map; -public final class ExtensionImpl implements Extension { +public final class ExtensionImpl implements Extension, Extension.Definition, Extension.Update { private ExtensionInner innerObject; private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - ExtensionImpl(ExtensionInner innerObject, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -33,6 +34,10 @@ public String etag() { return this.innerModel().etag(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String extensionId() { return this.innerModel().extensionId(); } @@ -53,6 +58,19 @@ public String extensionApiDocsLink() { return this.innerModel().extensionApiDocsLink(); } + public Map additionalApiProperties() { + Map inner = this.innerModel().additionalApiProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + public ExtensionInner innerModel() { return this.innerObject; } @@ -60,4 +78,117 @@ public ExtensionInner innerModel() { private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { return this.serviceManager; } + + private String resourceGroupName; + + private String dataManagerForAgricultureResourceName; + + private String extensionId; + + private ExtensionInstallationRequest createRequestBody; + + private ExtensionInstallationRequest updateRequestBody; + + public ExtensionImpl withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName) { + this.resourceGroupName = resourceGroupName; + this.dataManagerForAgricultureResourceName = dataManagerForAgricultureResourceName; + return this; + } + + public Extension create() { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + createRequestBody, Context.NONE) + .getValue(); + return this; + } + + public Extension create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + createRequestBody, context) + .getValue(); + return this; + } + + ExtensionImpl(String name, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerObject = new ExtensionInner(); + this.serviceManager = serviceManager; + this.extensionId = name; + this.createRequestBody = new ExtensionInstallationRequest(); + } + + public ExtensionImpl update() { + this.updateRequestBody = new ExtensionInstallationRequest(); + return this; + } + + public Extension apply() { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + updateRequestBody, Context.NONE) + .getValue(); + return this; + } + + public Extension apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + updateRequestBody, context) + .getValue(); + return this; + } + + ExtensionImpl(ExtensionInner 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.extensionId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "extensions"); + } + + public Extension refresh() { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, Context.NONE) + .getValue(); + return this; + } + + public Extension refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExtensions() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context) + .getValue(); + return this; + } + + public ExtensionImpl withExtensionVersion(String extensionVersion) { + if (isInCreateMode()) { + this.createRequestBody.withExtensionVersion(extensionVersion); + return this; + } else { + this.updateRequestBody.withExtensionVersion(extensionVersion); + return this; + } + } + + public ExtensionImpl withAdditionalApiProperties(Map additionalApiProperties) { + if (isInCreateMode()) { + this.createRequestBody.withAdditionalApiProperties(additionalApiProperties); + return this; + } else { + this.updateRequestBody.withAdditionalApiProperties(additionalApiProperties); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } } 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 dc71a237cff0..d306c717a3fc 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 @@ -4,6 +4,7 @@ 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; @@ -11,7 +12,6 @@ import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; @@ -30,6 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.agrifood.fluent.ExtensionsClient; import com.azure.resourcemanager.agrifood.fluent.models.ExtensionInner; +import com.azure.resourcemanager.agrifood.models.ExtensionInstallationRequest; import com.azure.resourcemanager.agrifood.models.ExtensionListResponse; import java.util.ArrayList; import java.util.List; @@ -37,22 +38,28 @@ import java.util.stream.Collectors; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ExtensionsClient. */ +/** + * An instance of this class provides access to all the operations defined in ExtensionsClient. + */ public final class ExtensionsClientImpl implements ExtensionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ExtensionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AgriFoodManagementClientImpl client; /** * Initializes an instance of ExtensionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ExtensionsClientImpl(AgriFoodManagementClientImpl client) { - this.service = - RestProxy.create(ExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -62,161 +69,118 @@ public final class ExtensionsClientImpl implements ExtensionsClient { */ @Host("{$host}") @ServiceInterface(name = "AgriFoodManagementCl") - private interface ExtensionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform" - + "/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}") - @ExpectedResponses({201}) + public interface ExtensionsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/extensions/{extensionId}") + @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @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/{extensionId}") - @ExpectedResponses({200}) + @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/{dataManagerForAgricultureResourceName}/extensions/{extensionId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @PathParam("extensionId") String extensionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @PathParam("extensionId") String extensionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform" - + "/farmBeats/{farmBeatsResourceName}/extensions/{extensionId}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/extensions/{extensionId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @PathParam("extensionId") String extensionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @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}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{dataManagerForAgricultureResourceName}/extensions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> listByDataManagerForAgriculture(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @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") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByFarmBeats( - @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, - @QueryParam("$maxPageSize") Integer maxPageSize, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("$maxPageSize") Integer maxPageSize, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByFarmBeatsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByDataManagerForAgricultureNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Install extension. - * + * 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. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extension resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String extensionId) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + 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.")); + 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.")); + 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 (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.")); } + if (requestBody != null) { + requestBody.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - extensionId, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, extensionId, this.client.getApiVersion(), + requestBody, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Install extension. - * + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -224,50 +188,44 @@ private Mono> createWithResponseAsync( * @return extension resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + 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.")); + 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.")); + 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 (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.")); } + if (requestBody != null) { + requestBody.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - extensionId, - this.client.getApiVersion(), - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + dataManagerForAgricultureResourceName, extensionId, this.client.getApiVersion(), requestBody, accept, + context); } /** - * Install extension. - * + * 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. @@ -275,80 +233,85 @@ private Mono> createWithResponseAsync( * @return extension resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String farmBeatsResourceName, String extensionId) { - return createWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId) { + final ExtensionInstallationRequest requestBody = null; + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + requestBody).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Install extension. - * + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extension resource. + * @return extension resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner create(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - return createAsync(resourceGroupName, farmBeatsResourceName, extensionId).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId, ExtensionInstallationRequest requestBody, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, + requestBody, context).block(); } /** - * Install extension. - * + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extension resource along with {@link Response}. + * @return extension resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context) { - return createWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId, context).block(); + public ExtensionInner createOrUpdate(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId) { + final ExtensionInstallationRequest requestBody = null; + 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. * @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} on successful completion of - * {@link Mono}. + * {@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.")); + 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.")); + 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 (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.")); @@ -356,78 +319,57 @@ private Mono> getWithResponseAsync( 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)) + 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())); } /** * 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. * @throws 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 along with {@link Response} on successful completion of - * {@link Mono}. + * {@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.")); + 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.")); + 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 (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"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - extensionId, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + 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. @@ -435,32 +377,17 @@ private Mono> getWithResponseAsync( * @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())); } /** * 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 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. - * @return installed extension details by extension id. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner get(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - return getAsync(resourceGroupName, farmBeatsResourceName, extensionId).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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -469,174 +396,35 @@ public ExtensionInner get(String resourceGroupName, String farmBeatsResourceName * @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(); - } - - /** - * Upgrade to latest extension. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats 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. - * @return extension resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String extensionId) { - 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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 - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - extensionId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Upgrade to latest extension. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats 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. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extension resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String extensionId, 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - extensionId, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Upgrade to latest extension. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats 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. - * @return extension resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String farmBeatsResourceName, String extensionId) { - return updateWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Upgrade to latest extension. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats 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. - * @return extension resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner update(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - return updateAsync(resourceGroupName, farmBeatsResourceName, extensionId).block(); + public Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String extensionId, Context context) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context) + .block(); } /** - * Upgrade to latest extension. - * + * 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. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extension resource along with {@link Response}. + * @return installed extension details by extension id. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context) { - return updateWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId, context).block(); + 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. @@ -644,27 +432,23 @@ public Response updateWithResponse( * @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.")); + 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.")); + 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 (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.")); @@ -672,25 +456,16 @@ private Mono> deleteWithResponseAsync( 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)) + 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())); } /** * 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. @@ -699,50 +474,38 @@ private Mono> deleteWithResponseAsync( * @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.")); + 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.")); + 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 (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"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - extensionId, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + 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. @@ -750,52 +513,55 @@ private Mono> deleteWithResponseAsync( * @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()); } /** * 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. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - deleteAsync(resourceGroupName, farmBeatsResourceName, extensionId).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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context) { - return deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName, extensionId, context).block(); + 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). Minimum = 10, Maximum = 1000, Default value = 50. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. * @param skipToken Skip 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. @@ -803,78 +569,51 @@ public Response deleteWithResponse( * @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.")); + 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.")); + 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 (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) - ? new ArrayList<>() - : extensionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - List extensionCategoriesConverted = - (extensionCategories == null) - ? new ArrayList<>() - : extensionCategories.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List extensionIdsConverted = (extensionIds == null) + ? new ArrayList<>() + : extensionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List extensionCategoriesConverted = (extensionCategories == null) + ? 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)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .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())); } /** * 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). Minimum = 10, Maximum = 1000, Default value = 50. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. * @param skipToken Skip token for getting next set of results. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -883,76 +622,50 @@ private Mono> listByFarmBeatsSinglePageAsync( * @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.")); + 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.")); + 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 (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) - ? new ArrayList<>() - : extensionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - List extensionCategoriesConverted = - (extensionCategories == null) - ? new ArrayList<>() - : extensionCategories.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List extensionIdsConverted = (extensionIds == null) + ? new ArrayList<>() + : extensionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List extensionCategoriesConverted = (extensionCategories == null) + ? new ArrayList<>() + : 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) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .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)); } /** * 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). Minimum = 10, Maximum = 1000, Default value = 50. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. * @param skipToken Skip 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. @@ -960,61 +673,47 @@ private Mono> listByFarmBeatsSinglePageAsync( * @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) { + private PagedFlux listByDataManagerForAgricultureAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken) { return new PagedFlux<>( - () -> - listByFarmBeatsSinglePageAsync( - resourceGroupName, - farmBeatsResourceName, - extensionIds, - extensionCategories, - maxPageSize, - skipToken), - nextLink -> listByFarmBeatsNextSinglePageAsync(nextLink)); + () -> 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)); + () -> 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). Minimum = 10, Maximum = 1000, Default value = 50. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. * @param skipToken Skip token for getting next set of results. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1023,56 +722,44 @@ 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). Minimum = 10, Maximum = 1000, Default value = 50. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. * @param skipToken Skip token for getting next set of results. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1081,97 +768,70 @@ 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)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return 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}. + * 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.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.listByFarmBeatsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .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())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return 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}. + * 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.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 - .listByFarmBeatsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + 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 4632d5ee09ae..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 @@ -22,38 +22,27 @@ public final class ExtensionsImpl implements Extensions { private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - public ExtensionsImpl( - ExtensionsClient innerClient, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + public ExtensionsImpl(ExtensionsClient innerClient, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Extension create(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - ExtensionInner inner = this.serviceClient().create(resourceGroupName, farmBeatsResourceName, extensionId); + public Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context); if (inner != null) { - return new ExtensionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context) { - Response inner = - this.serviceClient().createWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ExtensionImpl(inner.getValue(), this.manager())); } else { return null; } } - 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 { @@ -61,80 +50,107 @@ public Extension get(String resourceGroupName, String farmBeatsResourceName, Str } } - public Response getWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExtensionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context); } - public Extension update(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - ExtensionInner inner = this.serviceClient().update(resourceGroupName, farmBeatsResourceName, extensionId); - if (inner != null) { - return new ExtensionImpl(inner, this.manager()); - } else { - return null; - } + public void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId) { + this.serviceClient().delete(resourceGroupName, dataManagerForAgricultureResourceName, extensionId); } - public Response updateWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context) { - Response inner = - this.serviceClient().updateWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExtensionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + 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 void delete(String resourceGroupName, String farmBeatsResourceName, String extensionId) { - this.serviceClient().delete(resourceGroupName, farmBeatsResourceName, extensionId); + public PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .listByDataManagerForAgriculture(resourceGroupName, dataManagerForAgricultureResourceName, extensionIds, + extensionCategories, maxPageSize, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, farmBeatsResourceName, extensionId, context); + public Extension 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 extensionId = ResourceManagerUtils.getValueFromIdByName(id, "extensions"); + if (extensionId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, Context.NONE) + .getValue(); } - public PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName) { - PagedIterable inner = - this.serviceClient().listByFarmBeats(resourceGroupName, farmBeatsResourceName); - return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); + 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 extensionId = ResourceManagerUtils.getValueFromIdByName(id, "extensions"); + if (extensionId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context); } - public PagedIterable listByFarmBeats( - String resourceGroupName, - String farmBeatsResourceName, - List extensionIds, - List extensionCategories, - Integer maxPageSize, - String skipToken, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByFarmBeats( - resourceGroupName, - farmBeatsResourceName, - extensionIds, - extensionCategories, - maxPageSize, - skipToken, - context); - return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); + 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 extensionId = ResourceManagerUtils.getValueFromIdByName(id, "extensions"); + if (extensionId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, 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 extensionId = ResourceManagerUtils.getValueFromIdByName(id, "extensions"); + if (extensionId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, extensionId, context); } private ExtensionsClient serviceClient() { @@ -144,4 +160,8 @@ private ExtensionsClient serviceClient() { private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { return this.serviceManager; } + + public ExtensionImpl define(String name) { + return new ExtensionImpl(name, this.manager()); + } } 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 aa907cb1905d..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/FarmBeatsExtensionsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsClientImpl.java deleted file mode 100644 index 7f57404c0341..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsClientImpl.java +++ /dev/null @@ -1,550 +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.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.agrifood.fluent.FarmBeatsExtensionsClient; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsExtensionListResponse; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in FarmBeatsExtensionsClient. */ -public final class FarmBeatsExtensionsClientImpl implements FarmBeatsExtensionsClient { - /** The proxy service used to perform REST calls. */ - private final FarmBeatsExtensionsService service; - - /** The service client containing this operation class. */ - private final AgriFoodManagementClientImpl client; - - /** - * Initializes an instance of FarmBeatsExtensionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FarmBeatsExtensionsClientImpl(AgriFoodManagementClientImpl client) { - this.service = - RestProxy.create(FarmBeatsExtensionsService.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. - */ - @Host("{$host}") - @ServiceInterface(name = "AgriFoodManagementCl") - private interface FarmBeatsExtensionsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam(value = "farmBeatsExtensionIds", multipleQueryParams = true) List farmBeatsExtensionIds, - @QueryParam(value = "farmBeatsExtensionNames", multipleQueryParams = true) - List farmBeatsExtensionNames, - @QueryParam(value = "extensionCategories", multipleQueryParams = true) List extensionCategories, - @QueryParam(value = "publisherIds", multipleQueryParams = true) List publisherIds, - @QueryParam("$maxPageSize") Integer maxPageSize, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions/{farmBeatsExtensionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("farmBeatsExtensionId") String farmBeatsExtensionId, - @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( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get list of farmBeats extension. - * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. - * @param extensionCategories Extension categories. - * @param publisherIds Publisher ids. - * @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 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) { - 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"; - List farmBeatsExtensionIdsConverted = - (farmBeatsExtensionIds == null) - ? new ArrayList<>() - : farmBeatsExtensionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - List farmBeatsExtensionNamesConverted = - (farmBeatsExtensionNames == null) - ? new ArrayList<>() - : farmBeatsExtensionNames.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - List extensionCategoriesConverted = - (extensionCategories == null) - ? new ArrayList<>() - : extensionCategories.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - List publisherIdsConverted = - (publisherIds == null) - ? new ArrayList<>() - : publisherIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil - .withContext( - context -> - 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get list of farmBeats extension. - * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. - * @param extensionCategories Extension categories. - * @param publisherIds Publisher ids. - * @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 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, - Context context) { - 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"; - List farmBeatsExtensionIdsConverted = - (farmBeatsExtensionIds == null) - ? new ArrayList<>() - : farmBeatsExtensionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - List farmBeatsExtensionNamesConverted = - (farmBeatsExtensionNames == null) - ? new ArrayList<>() - : farmBeatsExtensionNames.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - List extensionCategoriesConverted = - (extensionCategories == null) - ? new ArrayList<>() - : extensionCategories.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - List publisherIdsConverted = - (publisherIds == null) - ? new ArrayList<>() - : publisherIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - context = this.client.mergeContext(context); - return 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)); - } - - /** - * Get list of farmBeats extension. - * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. - * @param extensionCategories Extension categories. - * @param publisherIds Publisher ids. - * @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 extension as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - List farmBeatsExtensionIds, - List farmBeatsExtensionNames, - List extensionCategories, - List publisherIds, - Integer maxPageSize) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - farmBeatsExtensionIds, farmBeatsExtensionNames, extensionCategories, publisherIds, maxPageSize), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of farmBeats 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final List farmBeatsExtensionIds = null; - final List farmBeatsExtensionNames = null; - final List extensionCategories = null; - final List publisherIds = null; - final Integer maxPageSize = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - farmBeatsExtensionIds, farmBeatsExtensionNames, extensionCategories, publisherIds, maxPageSize), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get list of farmBeats extension. - * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. - * @param extensionCategories Extension categories. - * @param publisherIds Publisher ids. - * @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 extension as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - List farmBeatsExtensionIds, - List farmBeatsExtensionNames, - List extensionCategories, - List publisherIds, - Integer maxPageSize, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - farmBeatsExtensionIds, - farmBeatsExtensionNames, - extensionCategories, - publisherIds, - maxPageSize, - context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get list of farmBeats 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final List farmBeatsExtensionIds = null; - final List farmBeatsExtensionNames = null; - final List extensionCategories = null; - final List publisherIds = null; - final Integer maxPageSize = null; - return new PagedIterable<>( - listAsync(farmBeatsExtensionIds, farmBeatsExtensionNames, extensionCategories, publisherIds, maxPageSize)); - } - - /** - * Get list of farmBeats extension. - * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. - * @param extensionCategories Extension categories. - * @param publisherIds Publisher ids. - * @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 extension as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - List farmBeatsExtensionIds, - List farmBeatsExtensionNames, - List extensionCategories, - List publisherIds, - Integer maxPageSize, - Context context) { - return new PagedIterable<>( - listAsync( - farmBeatsExtensionIds, - farmBeatsExtensionNames, - extensionCategories, - publisherIds, - maxPageSize, - context)); - } - - /** - * Get farmBeats extension. - * - * @param farmBeatsExtensionId farmBeatsExtensionId 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String farmBeatsExtensionId) { - 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - farmBeatsExtensionId, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get farmBeats extension. - * - * @param farmBeatsExtensionId farmBeatsExtensionId 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String farmBeatsExtensionId, 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), farmBeatsExtensionId, this.client.getApiVersion(), accept, context); - } - - /** - * Get farmBeats extension. - * - * @param farmBeatsExtensionId farmBeatsExtensionId 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String farmBeatsExtensionId) { - return getWithResponseAsync(farmBeatsExtensionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get farmBeats extension. - * - * @param farmBeatsExtensionId farmBeatsExtensionId 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsExtensionInner get(String farmBeatsExtensionId) { - return getAsync(farmBeatsExtensionId).block(); - } - - /** - * Get farmBeats extension. - * - * @param farmBeatsExtensionId farmBeatsExtensionId 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String farmBeatsExtensionId, Context context) { - return getWithResponseAsync(farmBeatsExtensionId, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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 - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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/FarmBeatsExtensionsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsImpl.java deleted file mode 100644 index 0f5b98b443bd..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsExtensionsImpl.java +++ /dev/null @@ -1,85 +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 Utils.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 Utils.mapPage(inner, inner1 -> new FarmBeatsExtensionImpl(inner1, this.manager())); - } - - public FarmBeatsExtension get(String farmBeatsExtensionId) { - FarmBeatsExtensionInner inner = this.serviceClient().get(farmBeatsExtensionId); - if (inner != null) { - return new FarmBeatsExtensionImpl(inner, this.manager()); - } else { - return null; - } - } - - 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; - } - } - - 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/FarmBeatsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsImpl.java deleted file mode 100644 index 065faced5d75..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsImpl.java +++ /dev/null @@ -1,236 +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.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; -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.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.Map; - -public final class FarmBeatsImpl implements FarmBeats, FarmBeats.Definition, FarmBeats.Update { - private FarmBeatsInner 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 String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public Identity identity() { - return this.innerModel().identity(); - } - - 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 Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public FarmBeatsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String farmBeatsResourceName; - - private FarmBeatsUpdateRequestModel updateBody; - - public FarmBeatsImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public FarmBeats create() { - this.innerObject = - serviceManager - .serviceClient() - .getFarmBeatsModels() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public FarmBeats create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getFarmBeatsModels() - .createOrUpdateWithResponse(resourceGroupName, farmBeatsResourceName, this.innerModel(), context) - .getValue(); - return this; - } - - FarmBeatsImpl(String name, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { - this.innerObject = new FarmBeatsInner(); - this.serviceManager = serviceManager; - this.farmBeatsResourceName = name; - } - - public FarmBeatsImpl update() { - this.updateBody = new FarmBeatsUpdateRequestModel(); - return this; - } - - public FarmBeats apply() { - this.innerObject = - serviceManager - .serviceClient() - .getFarmBeatsModels() - .update(resourceGroupName, farmBeatsResourceName, updateBody, Context.NONE); - return this; - } - - public FarmBeats apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getFarmBeatsModels() - .update(resourceGroupName, farmBeatsResourceName, updateBody, context); - return this; - } - - FarmBeatsImpl(FarmBeatsInner innerObject, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.farmBeatsResourceName = Utils.getValueFromIdByName(innerObject.id(), "farmBeats"); - } - - public FarmBeats refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getFarmBeatsModels() - .getByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, Context.NONE) - .getValue(); - return this; - } - - public FarmBeats refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getFarmBeatsModels() - .getByResourceGroupWithResponse(resourceGroupName, farmBeatsResourceName, context) - .getValue(); - return this; - } - - public FarmBeatsImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public FarmBeatsImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public FarmBeatsImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateBody.withTags(tags); - return this; - } - } - - public FarmBeatsImpl withIdentity(Identity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updateBody.withIdentity(identity); - return this; - } - } - - public FarmBeatsImpl withSensorIntegration(SensorIntegration sensorIntegration) { - this.innerModel().withSensorIntegration(sensorIntegration); - return this; - } - - public FarmBeatsImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.innerModel().withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - public FarmBeatsImpl withProperties(FarmBeatsUpdateProperties properties) { - this.updateBody.withProperties(properties); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} 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/FarmBeatsModelsClientImpl.java deleted file mode 100644 index 06ff014400f4..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsClientImpl.java +++ /dev/null @@ -1,1623 +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.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.agrifood.fluent.FarmBeatsModelsClient; -import com.azure.resourcemanager.agrifood.fluent.models.ArmAsyncOperationInner; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsListResponse; -import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateRequestModel; -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. */ -public final class FarmBeatsModelsClientImpl implements FarmBeatsModelsClient { - /** The proxy service used to perform REST calls. */ - private final FarmBeatsModelsService service; - - /** The service client containing this operation class. */ - private final AgriFoodManagementClientImpl client; - - /** - * Initializes an instance of FarmBeatsModelsClientImpl. - * - * @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()); - this.client = client; - } - - /** - * The interface defining all the services for AgriFoodManagementClientFarmBeatsModels to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AgriFoodManagementCl") - private interface FarmBeatsModelsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform" - + "/farmBeats/{farmBeatsResourceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @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}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - 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); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform" - + "/farmBeats/{farmBeatsResourceName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FarmBeatsUpdateRequestModel body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform" - + "/farmBeats/{farmBeatsResourceName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @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, - @QueryParam("$maxPageSize") Integer maxPageSize, - @QueryParam("$skipToken") String skipToken, - @PathParam("subscriptionId") String subscriptionId, - @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") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - 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, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform" - + "/farmBeats/{farmBeatsResourceName}/operationResults/{operationResultsId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOperationResult( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @QueryParam("api-version") String apiVersion, - @PathParam("operationResultsId") String operationResultsId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get FarmBeats resource. - * - * @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 farmBeats resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName) { - 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get FarmBeats resource. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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); - } - - /** - * Get FarmBeats resource. - * - * @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 farmBeats resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String farmBeatsResourceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, farmBeatsResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get FarmBeats resource. - * - * @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 farmBeats resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsInner getByResourceGroup(String resourceGroupName, String farmBeatsResourceName) { - return getByResourceGroupAsync(resourceGroupName, farmBeatsResourceName).block(); - } - - /** - * Get FarmBeats resource. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String farmBeatsResourceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, farmBeatsResourceName, context).block(); - } - - /** - * Create or update FarmBeats 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsInner body) { - 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - this.client.getApiVersion(), - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update FarmBeats 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsInner body, 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - this.client.getApiVersion(), - body, - accept, - context); - } - - /** - * Create or update FarmBeats 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsInner body) { - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create or update FarmBeats 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsInner createOrUpdate(String resourceGroupName, String farmBeatsResourceName, FarmBeatsInner body) { - return createOrUpdateAsync(resourceGroupName, farmBeatsResourceName, body).block(); - } - - /** - * Create or update FarmBeats 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsInner body, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, farmBeatsResourceName, body, context).block(); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body) { - 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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 - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - this.client.getApiVersion(), - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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 - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - this.client.getApiVersion(), - body, - accept, - context); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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. - */ - @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()); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, FarmBeatsInner> beginUpdateAsync( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, 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); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, FarmBeatsInner> beginUpdate( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body) { - return beginUpdateAsync(resourceGroupName, farmBeatsResourceName, body).getSyncPoller(); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, FarmBeatsInner> beginUpdate( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, Context context) { - return beginUpdateAsync(resourceGroupName, farmBeatsResourceName, body, context).getSyncPoller(); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body) { - return beginUpdateAsync(resourceGroupName, farmBeatsResourceName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, Context context) { - return beginUpdateAsync(resourceGroupName, farmBeatsResourceName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsInner update( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body) { - return updateAsync(resourceGroupName, farmBeatsResourceName, body).block(); - } - - /** - * Update a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param body 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FarmBeatsInner update( - String resourceGroupName, String farmBeatsResourceName, FarmBeatsUpdateRequestModel body, Context context) { - return updateAsync(resourceGroupName, farmBeatsResourceName, body, context).block(); - } - - /** - * Delete a FarmBeats resource. - * - * @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 the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String farmBeatsResourceName) { - 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a FarmBeats resource. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName 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); - } - - /** - * Delete a FarmBeats resource. - * - * @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 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()); - } - - /** - * Delete a FarmBeats resource. - * - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String farmBeatsResourceName) { - deleteAsync(resourceGroupName, farmBeatsResourceName).block(); - } - - /** - * Delete a FarmBeats resource. - * - * @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, farmBeatsResourceName, context).block(); - } - - /** - * Lists the FarmBeats instances for a subscription. - * - * @param maxPageSize Maximum number of items needed (inclusive). Minimum = 10, Maximum = 1000, Default value = 50. - * @param skipToken Skip 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(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.")); - } - final String accept = "application/json"; - 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the FarmBeats instances for a subscription. - * - * @param maxPageSize Maximum number of items needed (inclusive). Minimum = 10, Maximum = 1000, Default value = 50. - * @param skipToken Skip 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( - 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); - } - - /** - * Lists the FarmBeats instances for a subscription. - * - * @param maxPageSize Maximum number of items needed (inclusive). Minimum = 10, Maximum = 1000, Default value = 50. - * @param skipToken Skip 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(Integer maxPageSize, String skipToken) { - return new PagedFlux<>( - () -> listSinglePageAsync(maxPageSize, skipToken), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the FarmBeats 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. - * @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() { - final Integer maxPageSize = null; - final String skipToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(maxPageSize, skipToken), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the FarmBeats instances for a subscription. - * - * @param maxPageSize Maximum number of items needed (inclusive). Minimum = 10, Maximum = 1000, Default value = 50. - * @param skipToken Skip 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(Integer maxPageSize, String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(maxPageSize, skipToken, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the FarmBeats 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. - * @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() { - final Integer maxPageSize = null; - final String skipToken = null; - return new PagedIterable<>(listAsync(maxPageSize, skipToken)); - } - - /** - * Lists the FarmBeats instances for a subscription. - * - * @param maxPageSize Maximum number of items needed (inclusive). Minimum = 10, Maximum = 1000, Default value = 50. - * @param skipToken Skip 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(Integer maxPageSize, String skipToken, Context context) { - return new PagedIterable<>(listAsync(maxPageSize, skipToken, context)); - } - - /** - * Lists the FarmBeats 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). 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> 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.")); - } - 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.")); - } - final String accept = "application/json"; - 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the FarmBeats 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). 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> 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.")); - } - 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); - } - - /** - * Lists the FarmBeats 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). 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 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. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 listByResourceGroupAsync(String resourceGroupName) { - final Integer maxPageSize = null; - final String skipToken = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, maxPageSize, skipToken), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists the FarmBeats 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). 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 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. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 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. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 listByResourceGroup( - String resourceGroupName, Integer maxPageSize, String skipToken, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, maxPageSize, skipToken, context)); - } - - /** - * Get operationResults for a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param operationResultsId The operation results id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOperationResultWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId) { - 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); - } - if (operationResultsId == null) { - return Mono - .error(new IllegalArgumentException("Parameter operationResultsId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getOperationResult( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - this.client.getApiVersion(), - operationResultsId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get operationResults for a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param operationResultsId The operation results id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOperationResultWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId, 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 (farmBeatsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter farmBeatsResourceName is required and cannot be null.")); - } - if (operationResultsId == null) { - return Mono - .error(new IllegalArgumentException("Parameter operationResultsId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getOperationResult( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - this.client.getApiVersion(), - operationResultsId, - accept, - context); - } - - /** - * Get operationResults for a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param operationResultsId The operation results id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getOperationResultAsync( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId) { - return getOperationResultWithResponseAsync(resourceGroupName, farmBeatsResourceName, operationResultsId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get operationResults for a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param operationResultsId The operation results id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ArmAsyncOperationInner getOperationResult( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId) { - return getOperationResultAsync(resourceGroupName, farmBeatsResourceName, operationResultsId).block(); - } - - /** - * Get operationResults for a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param operationResultsId The operation results id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationResultWithResponse( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId, Context context) { - return getOperationResultWithResponseAsync( - resourceGroupName, farmBeatsResourceName, operationResultsId, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/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 1738557827c2..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/FarmBeatsModelsImpl.java +++ /dev/null @@ -1,201 +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.ArmAsyncOperationInner; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; -import com.azure.resourcemanager.agrifood.models.ArmAsyncOperation; -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 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 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 void deleteByResourceGroup(String resourceGroupName, String farmBeatsResourceName) { - this.serviceClient().delete(resourceGroupName, farmBeatsResourceName); - } - - public Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, farmBeatsResourceName, context); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.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 Utils.mapPage(inner, inner1 -> new FarmBeatsImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.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 Utils.mapPage(inner, inner1 -> new FarmBeatsImpl(inner1, this.manager())); - } - - public ArmAsyncOperation getOperationResult( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId) { - ArmAsyncOperationInner inner = - this.serviceClient().getOperationResult(resourceGroupName, farmBeatsResourceName, operationResultsId); - if (inner != null) { - return new ArmAsyncOperationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getOperationResultWithResponse( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId, Context context) { - Response inner = - this - .serviceClient() - .getOperationResultWithResponse(resourceGroupName, farmBeatsResourceName, operationResultsId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ArmAsyncOperationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public FarmBeats getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String farmBeatsResourceName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String farmBeatsResourceName = Utils.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 = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String farmBeatsResourceName = Utils.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.deleteWithResponse(resourceGroupName, farmBeatsResourceName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String farmBeatsResourceName = Utils.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.deleteWithResponse(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 3d556cf051ee..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 new file mode 100644 index 000000000000..a4c572f50d7d --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsClientImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.OperationResultsClient; +import com.azure.resourcemanager.agrifood.fluent.models.ArmAsyncOperationInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationResultsClient. + */ +public final class OperationResultsClientImpl implements OperationResultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationResultsService service; + + /** + * The service client containing this operation class. + */ + private final AgriFoodManagementClientImpl client; + + /** + * Initializes an instance of OperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationResultsClientImpl(AgriFoodManagementClientImpl client) { + this.service + = RestProxy.create(OperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AgriFoodManagementClientOperationResults to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AgriFoodManagementCl") + public interface OperationResultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AgFoodPlatform/locations/{locations}/operationResults/{operationResultsId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("locations") String locations, @PathParam("operationResultsId") String operationResultsId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get operationResults for a Data Manager For Agriculture resource. + * + * @param locations Location. + * @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 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) { + 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 (locations == null) { + return Mono.error(new IllegalArgumentException("Parameter locations is required and cannot be null.")); + } + if (operationResultsId == null) { + return Mono + .error(new IllegalArgumentException("Parameter operationResultsId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), locations, operationResultsId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get operationResults for a Data Manager For Agriculture resource. + * + * @param locations Location. + * @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 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, + 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 (locations == null) { + return Mono.error(new IllegalArgumentException("Parameter locations is required and cannot be null.")); + } + if (operationResultsId == null) { + return Mono + .error(new IllegalArgumentException("Parameter operationResultsId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), + locations, operationResultsId, accept, context); + } + + /** + * Get operationResults for a Data Manager For Agriculture resource. + * + * @param locations Location. + * @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 Data Manager For Agriculture resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locations, String operationResultsId) { + return getWithResponseAsync(locations, operationResultsId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get operationResults for a Data Manager For Agriculture resource. + * + * @param locations Location. + * @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 Data Manager For Agriculture resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String locations, String operationResultsId, + Context context) { + return getWithResponseAsync(locations, operationResultsId, context).block(); + } + + /** + * Get operationResults for a Data Manager For Agriculture resource. + * + * @param locations Location. + * @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 Data Manager For Agriculture resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArmAsyncOperationInner get(String locations, String operationResultsId) { + return getWithResponse(locations, operationResultsId, Context.NONE).getValue(); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsImpl.java new file mode 100644 index 000000000000..5b8a01df0f5a --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationResultsImpl.java @@ -0,0 +1,56 @@ +// 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.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.OperationResultsClient; +import com.azure.resourcemanager.agrifood.fluent.models.ArmAsyncOperationInner; +import com.azure.resourcemanager.agrifood.models.ArmAsyncOperation; +import com.azure.resourcemanager.agrifood.models.OperationResults; + +public final class OperationResultsImpl implements OperationResults { + private static final ClientLogger LOGGER = new ClientLogger(OperationResultsImpl.class); + + private final OperationResultsClient innerClient; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + public OperationResultsImpl(OperationResultsClient innerClient, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String locations, String operationResultsId, Context context) { + Response inner + = this.serviceClient().getWithResponse(locations, operationResultsId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ArmAsyncOperationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArmAsyncOperation get(String locations, String operationResultsId) { + ArmAsyncOperationInner inner = this.serviceClient().get(locations, operationResultsId); + if (inner != null) { + return new ArmAsyncOperationImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationResultsClient 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/OperationsClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationsClientImpl.java index 5acab3309347..3236a1749987 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationsClientImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationsClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.agrifood.models.OperationListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AgriFoodManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(AgriFoodManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -55,100 +61,75 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "AgriFoodManagementCl") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.AgFoodPlatform/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Lists the available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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.list(this.client.getEndpoint(), 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 available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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 - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -157,27 +138,27 @@ private PagedFlux listAsync() { /** * Lists the available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists the available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -186,13 +167,13 @@ public PagedIterable list() { /** * Lists the available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -201,14 +182,15 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -216,37 +198,28 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -254,23 +227,13 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + 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)); + 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/OperationsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationsImpl.java index 2ab16c7cb4fe..573b06af74e7 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationsImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/OperationsImpl.java @@ -19,20 +19,20 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { 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 eedee8dc8aa5..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 @@ -11,6 +11,8 @@ import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnection; import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.List; public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { @@ -34,6 +36,15 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public PrivateEndpoint privateEndpoint() { return this.innerModel().privateEndpoint(); } @@ -60,39 +71,32 @@ 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) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); return this; } public PrivateEndpointConnection create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdateWithResponse( - resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, this.innerModel(), context) + .getValue(); return this; } @@ -107,57 +111,49 @@ public PrivateEndpointConnectionImpl update() { } public PrivateEndpointConnection apply() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdateWithResponse( - resourceGroupName, - farmBeatsResourceName, - privateEndpointConnectionName, - this.innerModel(), - Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); return this; } public PrivateEndpointConnection apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdateWithResponse( - resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, this.innerModel(), context) + .getValue(); return this; } - PrivateEndpointConnectionImpl( - PrivateEndpointConnectionInner innerObject, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.farmBeatsResourceName = Utils.getValueFromIdByName(innerObject.id(), "farmBeats"); - this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dataManagerForAgricultureResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "farmBeats"); + this.privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); } public PrivateEndpointConnection refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + Context.NONE) + .getValue(); return this; } public PrivateEndpointConnection refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + context) + .getValue(); return this; } @@ -166,8 +162,8 @@ public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint private return this; } - public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionImpl + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); 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 bbd4afde86ed..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,29 +29,33 @@ 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; -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateEndpointConnectionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AgriFoodManagementClientImpl client; /** * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PrivateEndpointConnectionsClientImpl(AgriFoodManagementClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -65,448 +65,370 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi */ @Host("{$host}") @ServiceInterface(name = "AgriFoodManagementCl") - private interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform" - + "/farmBeats/{farmBeatsResourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + public interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @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, + 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}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @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, + 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); + @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}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @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, + 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); + @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") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @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, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, 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 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}. + * @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) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + 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.")); + 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.")); + 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 (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.")); + 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + this.client.getApiVersion(), request, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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}. + * @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) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + 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.")); + 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.")); + 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 (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.")); + 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + 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}. + * @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())); + private Mono createOrUpdateAsync(String resourceGroupName, + 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. + * @return the private endpoint connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String farmBeatsResourceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner body) { - return createOrUpdateAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, body) - .block(); + public Response createOrUpdateWithResponse(String resourceGroupName, + 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 context The context to associate with this operation. + * @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}. + * @return the private endpoint connection resource. */ @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(); + 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. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName) { + private Mono> getWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (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.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.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())); } /** * 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. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + 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.")); + 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.")); + 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 (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.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + 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. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @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. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection object. + * @return private endpoint connection object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName).block(); + public Response getWithResponse(String resourceGroupName, + 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. - * @param context The context 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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection object along with {@link Response}. + * @return private endpoint connection object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context) - .block(); + public PrivateEndpointConnectionInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName) { + 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. @@ -514,56 +436,41 @@ public Response getWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (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.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.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())); } /** * 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. @@ -572,53 +479,40 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + 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.")); + 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.")); + 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 (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.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - farmBeatsResourceName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + 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. @@ -626,21 +520,19 @@ private Mono>> deleteWithResponseAsync( * @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); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + 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()); } /** * 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. @@ -649,21 +541,20 @@ private PollerFlux, Void> beginDeleteAsync( * @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); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, + dataManagerForAgricultureResourceName, privateEndpointConnectionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + 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. @@ -671,17 +562,18 @@ private PollerFlux, Void> beginDeleteAsync( * @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 beginDeleteAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName) { + return this + .beginDeleteAsync(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName) .getSyncPoller(); } /** * 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. @@ -690,17 +582,19 @@ public SyncPoller, Void> beginDelete( * @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 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(); } /** * 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. @@ -708,18 +602,18 @@ public SyncPoller, Void> beginDelete( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName) + private Mono deleteAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName) .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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -728,33 +622,33 @@ private Mono deleteAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAsync(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName, Context context) { + 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. @@ -762,180 +656,135 @@ 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 {@link - * Mono}. + * @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.")); + 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.")); + 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 (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)) + .withContext(context -> service.listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 {@link - * Mono}. + * @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.")); + 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.")); + 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 (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}. + * @return list of Private endpoint connections along with {@link Response}. */ - @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}. - */ - @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 7b7ed9ae0bbd..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 { @@ -21,180 +22,154 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - public PrivateEndpointConnectionsImpl( - PrivateEndpointConnectionsClient innerClient, + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PrivateEndpointConnection get( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner = - this.serviceClient().get(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName); + public Response getWithResponse(String resourceGroupName, + String dataManagerForAgricultureResourceName, String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + context); if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, farmBeatsResourceName, privateEndpointConnectionName, context); + public PrivateEndpointConnection get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = this.serviceClient() + .get(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + return new PrivateEndpointConnectionImpl(inner, this.manager()); } else { return null; } } - 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 Utils.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 Utils.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) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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 = Utils.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))); - } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + 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 privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); + 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.NONE) + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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 = Utils.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))); - } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + 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 privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - 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); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, + privateEndpointConnectionName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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 = Utils.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))); - } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + 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 privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - 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); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.delete(resourceGroupName, dataManagerForAgricultureResourceName, privateEndpointConnectionName, + Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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 = Utils.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))); - } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + 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 privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - 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); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + 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/PrivateLinkResourceImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourceImpl.java index 4a684780c9cd..840162ffc631 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourceImpl.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/PrivateLinkResourceImpl.java @@ -15,8 +15,8 @@ public final class PrivateLinkResourceImpl implements PrivateLinkResource { private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - PrivateLinkResourceImpl( - PrivateLinkResourceInner innerObject, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } 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 dc72e8ac2278..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,26 +23,31 @@ 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; -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateLinkResourcesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AgriFoodManagementClientImpl client; /** * Initializes an instance of PrivateLinkResourcesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PrivateLinkResourcesClientImpl(AgriFoodManagementClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -56,242 +57,184 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource */ @Host("{$host}") @ServiceInterface(name = "AgriFoodManagementCl") - private interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform" - + "/farmBeats/{farmBeatsResourceName}/privateLinkResources") - @ExpectedResponses({200}) + public interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @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, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @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}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @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, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("farmBeatsResourceName") String farmBeatsResourceName, - @PathParam("subResourceName") String subResourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @PathParam("subResourceName") String subResourceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, 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 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.")); + 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.")); + 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 (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)) + .withContext(context -> service.listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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.")); + 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.")); + 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 (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. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private link resource object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String subResourceName) { + private Mono> getWithResponseAsync(String resourceGroupName, + String dataManagerForAgricultureResourceName, String subResourceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (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 @@ -299,55 +242,43 @@ private Mono> getWithResponseAsync( } 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())); } /** * 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. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private link resource object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String farmBeatsResourceName, String subResourceName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + 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.")); + 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.")); + 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 (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 @@ -355,68 +286,65 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + 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. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @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())); } /** * 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. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private link resource object. + * @return private link resource object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner get( - String resourceGroupName, String farmBeatsResourceName, String subResourceName) { - return getAsync(resourceGroupName, farmBeatsResourceName, subResourceName).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. - * @param context The context 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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private link resource object along with {@link Response}. + * @return private link resource object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String farmBeatsResourceName, String subResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, farmBeatsResourceName, subResourceName, context).block(); + public PrivateLinkResourceInner get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String subResourceName) { + 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 69255b42fd27..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 { @@ -21,45 +22,53 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources { private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; - public PrivateLinkResourcesImpl( - PrivateLinkResourcesClient innerClient, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listByResource(String resourceGroupName, String farmBeatsResourceName) { - PagedIterable inner = - this.serviceClient().listByResource(resourceGroupName, farmBeatsResourceName); - return Utils.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 Utils.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 PrivateLinkResource get(String resourceGroupName, String farmBeatsResourceName, String subResourceName) { - PrivateLinkResourceInner inner = - this.serviceClient().get(resourceGroupName, farmBeatsResourceName, subResourceName); + 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 PrivateLinkResourceImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), 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 PrivateLinkResource get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String subResourceName) { + PrivateLinkResourceInner inner + = this.serviceClient().get(resourceGroupName, dataManagerForAgricultureResourceName, subResourceName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + return new PrivateLinkResourceImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/Utils.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ResourceManagerUtils.java similarity index 79% rename from sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/Utils.java rename to sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ResourceManagerUtils.java index e29c600593c0..c0c2cb96c027 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/Utils.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +87,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +127,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +189,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } 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 new file mode 100644 index 000000000000..fd229c6566ff --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionImpl.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.implementation; + +import com.azure.core.management.SystemData; +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.SolutionProperties; + +public final class SolutionImpl implements Solution, Solution.Definition, Solution.Update { + private SolutionInner 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 SolutionProperties 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 SolutionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String dataManagerForAgricultureResourceName; + + private String solutionId; + + public SolutionImpl withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName) { + this.resourceGroupName = resourceGroupName; + this.dataManagerForAgricultureResourceName = dataManagerForAgricultureResourceName; + return this; + } + + public Solution create() { + this.innerObject = serviceManager.serviceClient() + .getSolutions() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Solution create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSolutions() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + this.innerModel(), context) + .getValue(); + return this; + } + + SolutionImpl(String name, com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerObject = new SolutionInner(); + this.serviceManager = serviceManager; + this.solutionId = name; + } + + public SolutionImpl update() { + return this; + } + + public Solution apply() { + this.innerObject = serviceManager.serviceClient() + .getSolutions() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Solution apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSolutions() + .createOrUpdateWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, + this.innerModel(), context) + .getValue(); + return this; + } + + SolutionImpl(SolutionInner 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.solutionId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "solutions"); + } + + public Solution refresh() { + this.innerObject = serviceManager.serviceClient() + .getSolutions() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, Context.NONE) + .getValue(); + return this; + } + + public Solution refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSolutions() + .getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, context) + .getValue(); + return this; + } + + public SolutionImpl withProperties(SolutionProperties properties) { + 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 new file mode 100644 index 000000000000..fea2ba1a2df9 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsClientImpl.java @@ -0,0 +1,919 @@ +// 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.SolutionsClient; +import com.azure.resourcemanager.agrifood.fluent.models.SolutionInner; +import com.azure.resourcemanager.agrifood.models.SolutionListResponse; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SolutionsClient. + */ +public final class SolutionsClientImpl implements SolutionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SolutionsService service; + + /** + * The service client containing this operation class. + */ + private final AgriFoodManagementClientImpl client; + + /** + * Initializes an instance of SolutionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SolutionsClientImpl(AgriFoodManagementClientImpl client) { + this.service + = RestProxy.create(SolutionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AgriFoodManagementClientSolutions to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AgriFoodManagementCl") + public interface SolutionsService { + @Headers({ "Content-Type: application/json" }) + @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("dataManagerForAgricultureResourceName") String dataManagerForAgricultureResourceName, + @PathParam("solutionId") String solutionId, @QueryParam("api-version") String apiVersion, + @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/{dataManagerForAgricultureResourceName}/solutions/{solutionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @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/{dataManagerForAgricultureResourceName}/solutions/{solutionId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @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/{dataManagerForAgricultureResourceName}/solutions") + @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(value = "solutionIds", multipleQueryParams = true) List solutionIds, + @QueryParam(value = "ids", multipleQueryParams = true) List ids, + @QueryParam(value = "names", multipleQueryParams = true) List names, + @QueryParam(value = "propertyFilters", multipleQueryParams = true) List propertyFilters, + @QueryParam(value = "statuses", multipleQueryParams = true) List statuses, + @QueryParam("minCreatedDateTime") OffsetDateTime minCreatedDateTime, + @QueryParam("maxCreatedDateTime") OffsetDateTime maxCreatedDateTime, + @QueryParam("minLastModifiedDateTime") OffsetDateTime minLastModifiedDateTime, + @QueryParam("maxLastModifiedDateTime") OffsetDateTime maxLastModifiedDateTime, + @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); + } + + /** + * Install Or Update Solution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * @return solution resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + 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.")); + } + 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.")); + } + if (solutionId == null) { + return Mono.error(new IllegalArgumentException("Parameter solutionId is required and cannot be null.")); + } + if (requestBody != null) { + requestBody.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), + requestBody, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Install Or Update Solution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + 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.")); + } + 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.")); + } + if (solutionId == null) { + return Mono.error(new IllegalArgumentException("Parameter solutionId is required and cannot be null.")); + } + 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, + 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 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 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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 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 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + 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.")); + } + 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, + dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get installed Solution details by Solution id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * @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} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + 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.")); + } + if (solutionId == null) { + return Mono.error(new IllegalArgumentException("Parameter solutionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + 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 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 dataManagerForAgricultureResourceName, + String solutionId) { + return getWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get installed Solution details by Solution id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 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 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 dataManagerForAgricultureResourceName, String solutionId) { + 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.")); + } + 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, + dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Uninstall Solution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * @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 solutionId, 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.")); + } + if (solutionId == null) { + return Mono.error(new IllegalArgumentException("Parameter solutionId 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, + dataManagerForAgricultureResourceName, solutionId, this.client.getApiVersion(), accept, context); + } + + /** + * Uninstall Solution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 dataManagerForAgricultureResourceName, + String solutionId) { + return deleteWithResponseAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionId) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Uninstall Solution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + * @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 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 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 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 dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionIds Installed Solution ids. + * @param ids Ids of the resource. + * @param names Names of the resource. + * @param propertyFilters Filters on key-value pairs within the Properties object. + * eg. "{testKey} eq {testValue}". + * @param statuses Statuses of the resource. + * @param minCreatedDateTime Minimum creation date of resource (inclusive). + * @param maxCreatedDateTime Maximum creation date of resource (inclusive). + * @param minLastModifiedDateTime Minimum last modified date of resource (inclusive). + * @param maxLastModifiedDateTime Maximum last modified date of resource (inclusive). + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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 installed Solutions details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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) { + 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"; + List solutionIdsConverted = (solutionIds == null) + ? new ArrayList<>() + : solutionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List idsConverted = (ids == null) + ? new ArrayList<>() + : ids.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List namesConverted = (names == null) + ? new ArrayList<>() + : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List propertyFiltersConverted = (propertyFilters == null) + ? new ArrayList<>() + : propertyFilters.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List statusesConverted = (statuses == null) + ? 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, 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())); + } + + /** + * Get installed Solutions details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionIds Installed Solution ids. + * @param ids Ids of the resource. + * @param names Names of the resource. + * @param propertyFilters Filters on key-value pairs within the Properties object. + * eg. "{testKey} eq {testValue}". + * @param statuses Statuses of the resource. + * @param minCreatedDateTime Minimum creation date of resource (inclusive). + * @param maxCreatedDateTime Maximum creation date of resource (inclusive). + * @param minLastModifiedDateTime Minimum last modified date of resource (inclusive). + * @param maxLastModifiedDateTime Maximum last modified date of resource (inclusive). + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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 installed Solutions details along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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) { + 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"; + List solutionIdsConverted = (solutionIds == null) + ? new ArrayList<>() + : solutionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List idsConverted = (ids == null) + ? new ArrayList<>() + : ids.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List namesConverted = (names == null) + ? new ArrayList<>() + : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List propertyFiltersConverted = (propertyFilters == null) + ? new ArrayList<>() + : propertyFilters.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List statusesConverted = (statuses == null) + ? new ArrayList<>() + : 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, + 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)); + } + + /** + * Get installed Solutions details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionIds Installed Solution ids. + * @param ids Ids of the resource. + * @param names Names of the resource. + * @param propertyFilters Filters on key-value pairs within the Properties object. + * eg. "{testKey} eq {testValue}". + * @param statuses Statuses of the resource. + * @param minCreatedDateTime Minimum creation date of resource (inclusive). + * @param maxCreatedDateTime Maximum creation date of resource (inclusive). + * @param minLastModifiedDateTime Minimum last modified date of resource (inclusive). + * @param maxLastModifiedDateTime Maximum last modified date of resource (inclusive). + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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 installed Solutions details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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, 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 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 dataManagerForAgricultureResourceName) { + final List solutionIds = null; + final List ids = null; + final List names = null; + final List propertyFilters = null; + final List statuses = null; + final OffsetDateTime minCreatedDateTime = null; + final OffsetDateTime maxCreatedDateTime = null; + final OffsetDateTime minLastModifiedDateTime = null; + final OffsetDateTime maxLastModifiedDateTime = null; + final Integer maxPageSize = null; + final String skipToken = null; + 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 dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionIds Installed Solution ids. + * @param ids Ids of the resource. + * @param names Names of the resource. + * @param propertyFilters Filters on key-value pairs within the Properties object. + * eg. "{testKey} eq {testValue}". + * @param statuses Statuses of the resource. + * @param minCreatedDateTime Minimum creation date of resource (inclusive). + * @param maxCreatedDateTime Maximum creation date of resource (inclusive). + * @param minLastModifiedDateTime Minimum last modified date of resource (inclusive). + * @param maxLastModifiedDateTime Maximum last modified date of resource (inclusive). + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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 installed Solutions details as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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, dataManagerForAgricultureResourceName, solutionIds, ids, names, + propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, + maxLastModifiedDateTime, maxPageSize, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get installed Solutions details. + * + * @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 installed Solutions details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName) { + final List solutionIds = null; + final List ids = null; + final List names = null; + final List propertyFilters = null; + final List statuses = null; + final OffsetDateTime minCreatedDateTime = null; + final OffsetDateTime maxCreatedDateTime = null; + final OffsetDateTime minLastModifiedDateTime = null; + final OffsetDateTime maxLastModifiedDateTime = null; + final Integer maxPageSize = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, dataManagerForAgricultureResourceName, solutionIds, ids, + names, propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, + maxLastModifiedDateTime, maxPageSize, skipToken)); + } + + /** + * Get installed Solutions details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionIds Installed Solution ids. + * @param ids Ids of the resource. + * @param names Names of the resource. + * @param propertyFilters Filters on key-value pairs within the Properties object. + * eg. "{testKey} eq {testValue}". + * @param statuses Statuses of the resource. + * @param minCreatedDateTime Minimum creation date of resource (inclusive). + * @param maxCreatedDateTime Maximum creation date of resource (inclusive). + * @param minLastModifiedDateTime Minimum last modified date of resource (inclusive). + * @param maxLastModifiedDateTime Maximum last modified date of resource (inclusive). + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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 installed Solutions details as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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, dataManagerForAgricultureResourceName, solutionIds, ids, + names, propertyFilters, statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, + maxLastModifiedDateTime, maxPageSize, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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/SolutionsDiscoverabilitiesClientImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesClientImpl.java new file mode 100644 index 000000000000..bdabf48de2a9 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesClientImpl.java @@ -0,0 +1,422 @@ +// 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.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.agrifood.fluent.SolutionsDiscoverabilitiesClient; +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; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SolutionsDiscoverabilitiesClient. + */ +public final class SolutionsDiscoverabilitiesClientImpl implements SolutionsDiscoverabilitiesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SolutionsDiscoverabilitiesService service; + + /** + * The service client containing this operation class. + */ + private final AgriFoodManagementClientImpl client; + + /** + * Initializes an instance of SolutionsDiscoverabilitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SolutionsDiscoverabilitiesClientImpl(AgriFoodManagementClientImpl client) { + this.service = RestProxy.create(SolutionsDiscoverabilitiesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AgriFoodManagementClientSolutionsDiscoverabilities to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AgriFoodManagementCl") + public interface SolutionsDiscoverabilitiesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsSolutionDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam(value = "farmBeatsSolutionIds", multipleQueryParams = true) List farmBeatsSolutionIds, + @QueryParam( + value = "farmBeatsSolutionNames", + multipleQueryParams = true) List farmBeatsSolutionNames, + @QueryParam("$maxPageSize") Integer maxPageSize, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AgFoodPlatform/farmBeatsSolutionDefinitions/{dataManagerForAgricultureSolutionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get list of Data Manager For Agriculture solutions. + * + * @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 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) { + 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"; + List farmBeatsSolutionIdsConverted = (farmBeatsSolutionIds == null) + ? new ArrayList<>() + : farmBeatsSolutionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List farmBeatsSolutionNamesConverted = (farmBeatsSolutionNames == null) + ? new ArrayList<>() + : farmBeatsSolutionNames.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), farmBeatsSolutionIdsConverted, + farmBeatsSolutionNamesConverted, maxPageSize, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get list of Data Manager For Agriculture solutions. + * + * @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 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) { + 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"; + List farmBeatsSolutionIdsConverted = (farmBeatsSolutionIds == null) + ? new ArrayList<>() + : farmBeatsSolutionIds.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List farmBeatsSolutionNamesConverted = (farmBeatsSolutionNames == null) + ? new ArrayList<>() + : farmBeatsSolutionNames.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), farmBeatsSolutionIdsConverted, farmBeatsSolutionNamesConverted, + maxPageSize, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get list of Data Manager For Agriculture solutions. + * + * @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 Data Manager For Agriculture solutions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(List farmBeatsSolutionIds, + List farmBeatsSolutionNames, Integer maxPageSize) { + return new PagedFlux<>(() -> listSinglePageAsync(farmBeatsSolutionIds, farmBeatsSolutionNames, maxPageSize), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 Data Manager For Agriculture solutions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final List farmBeatsSolutionIds = null; + final List farmBeatsSolutionNames = null; + final Integer maxPageSize = null; + return new PagedFlux<>(() -> listSinglePageAsync(farmBeatsSolutionIds, farmBeatsSolutionNames, maxPageSize), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get list of Data Manager For Agriculture solutions. + * + * @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 Data Manager For Agriculture solutions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(List farmBeatsSolutionIds, + List farmBeatsSolutionNames, Integer maxPageSize, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(farmBeatsSolutionIds, farmBeatsSolutionNames, maxPageSize, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final List farmBeatsSolutionIds = null; + final List farmBeatsSolutionNames = null; + final Integer maxPageSize = null; + return new PagedIterable<>(listAsync(farmBeatsSolutionIds, farmBeatsSolutionNames, maxPageSize)); + } + + /** + * Get list of Data Manager For Agriculture solutions. + * + * @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 Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(List farmBeatsSolutionIds, + List farmBeatsSolutionNames, Integer maxPageSize, Context context) { + return new PagedIterable<>(listAsync(farmBeatsSolutionIds, farmBeatsSolutionNames, maxPageSize, context)); + } + + /** + * Get Data Manager For Agriculture solution by id. + * + * @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 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 dataManagerForAgricultureSolutionId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() 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(), dataManagerForAgricultureSolutionId, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Data Manager For Agriculture solution by id. + * + * @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 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 dataManagerForAgricultureSolutionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() 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(), dataManagerForAgricultureSolutionId, this.client.getApiVersion(), + accept, context); + } + + /** + * Get Data Manager For Agriculture solution by id. + * + * @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 data Manager For Agriculture solution by id on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String dataManagerForAgricultureSolutionId) { + return getWithResponseAsync(dataManagerForAgricultureSolutionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Data Manager For Agriculture solution by id. + * + * @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 data Manager For Agriculture solution by id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String dataManagerForAgricultureSolutionId, + Context context) { + return getWithResponseAsync(dataManagerForAgricultureSolutionId, context).block(); + } + + /** + * Get Data Manager For Agriculture solution by id. + * + * @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 data Manager For Agriculture solution by id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataManagerForAgricultureSolutionInner get(String dataManagerForAgricultureSolutionId) { + return getWithResponse(dataManagerForAgricultureSolutionId, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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/SolutionsDiscoverabilitiesImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesImpl.java new file mode 100644 index 000000000000..b21ff194d372 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsDiscoverabilitiesImpl.java @@ -0,0 +1,73 @@ +// 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.SolutionsDiscoverabilitiesClient; +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; + +public final class SolutionsDiscoverabilitiesImpl implements SolutionsDiscoverabilities { + private static final ClientLogger LOGGER = new ClientLogger(SolutionsDiscoverabilitiesImpl.class); + + private final SolutionsDiscoverabilitiesClient innerClient; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + public SolutionsDiscoverabilitiesImpl(SolutionsDiscoverabilitiesClient 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 DataManagerForAgricultureSolutionImpl(inner1, this.manager())); + } + + 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 DataManagerForAgricultureSolutionImpl(inner1, this.manager())); + } + + 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 DataManagerForAgricultureSolutionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataManagerForAgricultureSolution get(String dataManagerForAgricultureSolutionId) { + DataManagerForAgricultureSolutionInner inner = this.serviceClient().get(dataManagerForAgricultureSolutionId); + if (inner != null) { + return new DataManagerForAgricultureSolutionImpl(inner, this.manager()); + } else { + return null; + } + } + + private SolutionsDiscoverabilitiesClient 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/SolutionsImpl.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsImpl.java new file mode 100644 index 000000000000..936f860bad59 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/implementation/SolutionsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.SolutionsClient; +import com.azure.resourcemanager.agrifood.fluent.models.SolutionInner; +import com.azure.resourcemanager.agrifood.models.Solution; +import com.azure.resourcemanager.agrifood.models.Solutions; +import java.time.OffsetDateTime; +import java.util.List; + +public final class SolutionsImpl implements Solutions { + private static final ClientLogger LOGGER = new ClientLogger(SolutionsImpl.class); + + private final SolutionsClient innerClient; + + private final com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager; + + public SolutionsImpl(SolutionsClient innerClient, + com.azure.resourcemanager.agrifood.AgriFoodManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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())); + } else { + return null; + } + } + + 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 { + return null; + } + } + + 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 dataManagerForAgricultureResourceName, String solutionId) { + this.serviceClient().delete(resourceGroupName, dataManagerForAgricultureResourceName, solutionId); + } + + 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 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, dataManagerForAgricultureResourceName, solutionIds, ids, names, propertyFilters, + statuses, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, + maxPageSize, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SolutionImpl(inner1, this.manager())); + } + + public Solution 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 solutionId = ResourceManagerUtils.getValueFromIdByName(id, "solutions"); + if (solutionId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'solutions'.", id))); + } + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, 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 solutionId = ResourceManagerUtils.getValueFromIdByName(id, "solutions"); + if (solutionId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'solutions'.", id))); + } + return this.getWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, 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 solutionId = ResourceManagerUtils.getValueFromIdByName(id, "solutions"); + if (solutionId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'solutions'.", id))); + } + this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, 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 solutionId = ResourceManagerUtils.getValueFromIdByName(id, "solutions"); + if (solutionId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'solutions'.", id))); + } + return this.deleteWithResponse(resourceGroupName, dataManagerForAgricultureResourceName, solutionId, context); + } + + private SolutionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.agrifood.AgriFoodManager manager() { + return this.serviceManager; + } + + public SolutionImpl define(String name) { + return new SolutionImpl(name, this.manager()); + } +} 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 d2c72b52b867..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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for AgriFoodManagementClient. APIs documentation for Azure AgFoodPlatform - * Resource Provider Service. + * Package containing the implementations for AgriFoodManagementClient. + * 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/ActionType.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ActionType.java index a77db3112787..9d6882b45415 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ActionType.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ActionType.java @@ -8,14 +8,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ + /** + * Static value Internal for ActionType. + */ public static final ActionType INTERNAL = fromString("Internal"); + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + /** * Creates or finds a ActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionType. */ @@ -26,7 +39,7 @@ public static ActionType fromString(String name) { /** * Gets known ActionType values. - * + * * @return known ActionType values. */ public static Collection values() { 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..81c1de9452ae --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ApiKeyAuthCredentials.java @@ -0,0 +1,87 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ApiKeyAuthCredentials class for ApiKey based Auth. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ApiKeyAuthCredentials.class, visible = true) +@JsonTypeName("ApiKeyAuthCredentials") +@Fluent +public final class ApiKeyAuthCredentials extends AuthCredentials { + /* + * Enum for different types of AuthCredentials supported. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AuthCredentialsKind kind = AuthCredentialsKind.API_KEY_AUTH_CREDENTIALS; + + /* + * Properties of the key vault. + */ + @JsonProperty(value = "apiKey", required = true) + 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() { + super.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); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ApiProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ApiProperties.java new file mode 100644 index 000000000000..e426be0f7a55 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ApiProperties.java @@ -0,0 +1,56 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Api properties. + */ +@Fluent +public final class ApiProperties { + /* + * Interval in minutes for which the weather data for the api needs to be refreshed. + */ + @JsonProperty(value = "apiFreshnessTimeInMinutes") + private Integer apiFreshnessTimeInMinutes; + + /** + * Creates an instance of ApiProperties class. + */ + public ApiProperties() { + } + + /** + * Get the apiFreshnessTimeInMinutes property: Interval in minutes for which the weather data for the api needs to + * be refreshed. + * + * @return the apiFreshnessTimeInMinutes value. + */ + public Integer apiFreshnessTimeInMinutes() { + return this.apiFreshnessTimeInMinutes; + } + + /** + * Set the apiFreshnessTimeInMinutes property: Interval in minutes for which the weather data for the api needs to + * be refreshed. + * + * @param apiFreshnessTimeInMinutes the apiFreshnessTimeInMinutes value to set. + * @return the ApiProperties object itself. + */ + public ApiProperties withApiFreshnessTimeInMinutes(Integer apiFreshnessTimeInMinutes) { + this.apiFreshnessTimeInMinutes = apiFreshnessTimeInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ArmAsyncOperation.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ArmAsyncOperation.java index a3061e1adf17..6784419090f6 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ArmAsyncOperation.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ArmAsyncOperation.java @@ -6,18 +6,29 @@ import com.azure.resourcemanager.agrifood.fluent.models.ArmAsyncOperationInner; -/** An immutable client-side representation of ArmAsyncOperation. */ +/** + * An immutable client-side representation of ArmAsyncOperation. + */ public interface ArmAsyncOperation { /** * Gets the status property: Status of the async operation. - * + * * @return the status value. */ String status(); + /** + * Gets the error property: Arm async operation error class. + * Ref: + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format. + * + * @return the error value. + */ + ArmAsyncOperationError error(); + /** * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.ArmAsyncOperationInner object. - * + * * @return the inner object. */ ArmAsyncOperationInner innerModel(); diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ArmAsyncOperationError.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ArmAsyncOperationError.java new file mode 100644 index 000000000000..d0056089321c --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ArmAsyncOperationError.java @@ -0,0 +1,82 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Arm async operation error class. + * Ref: + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format. + */ +@Fluent +public final class ArmAsyncOperationError { + /* + * Status of the async operation. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Status of the async operation. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Creates an instance of ArmAsyncOperationError class. + */ + public ArmAsyncOperationError() { + } + + /** + * Get the code property: Status of the async operation. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Status of the async operation. + * + * @param code the code value to set. + * @return the ArmAsyncOperationError object itself. + */ + public ArmAsyncOperationError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Status of the async operation. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Status of the async operation. + * + * @param message the message value to set. + * @return the ArmAsyncOperationError object itself. + */ + public ArmAsyncOperationError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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..2d85c900c3ad --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentials.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AuthCredentials abstract base class for Auth Purpose. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AuthCredentials.class, visible = true) +@JsonTypeName("AuthCredentials") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ApiKeyAuthCredentials", value = ApiKeyAuthCredentials.class), + @JsonSubTypes.Type(name = "OAuthClientCredentials", value = OAuthClientCredentials.class) }) +@Immutable +public class AuthCredentials { + /* + * Enum for different types of AuthCredentials supported. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AuthCredentialsKind kind; + + /** + * Creates an instance of AuthCredentials class. + */ + public AuthCredentials() { + this.kind = AuthCredentialsKind.fromString("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() { + } +} 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..d2e04976662e --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/AuthCredentialsKind.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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 74% 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 4d413ecdbadb..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 @@ -7,29 +7,31 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Locations. */ -public interface Locations { +/** + * Resource collection API of CheckNameAvailabilities. + */ +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. + * @return the check availability result along with {@link Response}. */ - CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest body); + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context); /** * Checks the name availability of the resource with requested resource name. - * - * @param body NameAvailabilityRequest object. - * @param context The context to associate with this operation. + * + * @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 along with {@link Response}. + * @return the check availability result. */ - Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityRequest body, Context context); + CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest nameAvailabilityRequest); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityReason.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityReason.java index e7849e4cc040..e704e6ebdace 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityReason.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityReason.java @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The reason why the given name is not available. */ +/** + * The reason why the given name is not available. + */ public final class CheckNameAvailabilityReason extends ExpandableStringEnum { - /** Static value Invalid for CheckNameAvailabilityReason. */ + /** + * Static value Invalid for CheckNameAvailabilityReason. + */ public static final CheckNameAvailabilityReason INVALID = fromString("Invalid"); - /** Static value AlreadyExists for CheckNameAvailabilityReason. */ + /** + * Static value AlreadyExists for CheckNameAvailabilityReason. + */ public static final CheckNameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); + /** + * Creates a new instance of CheckNameAvailabilityReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CheckNameAvailabilityReason() { + } + /** * Creates or finds a CheckNameAvailabilityReason from its string representation. - * + * * @param name a name to look for. * @return the corresponding CheckNameAvailabilityReason. */ @@ -29,7 +44,7 @@ public static CheckNameAvailabilityReason fromString(String name) { /** * Gets known CheckNameAvailabilityReason values. - * + * * @return known CheckNameAvailabilityReason values. */ public static Collection values() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityRequest.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityRequest.java index bb5b3eb5406b..9f08d7db5f1d 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityRequest.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityRequest.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The check availability request body. */ +/** + * The check availability request body. + */ @Fluent public final class CheckNameAvailabilityRequest { /* @@ -22,9 +24,15 @@ public final class CheckNameAvailabilityRequest { @JsonProperty(value = "type") private String type; + /** + * Creates an instance of CheckNameAvailabilityRequest class. + */ + public CheckNameAvailabilityRequest() { + } + /** * Get the name property: The name of the resource for which availability needs to be checked. - * + * * @return the name value. */ public String name() { @@ -33,7 +41,7 @@ public String name() { /** * Set the name property: The name of the resource for which availability needs to be checked. - * + * * @param name the name value to set. * @return the CheckNameAvailabilityRequest object itself. */ @@ -44,7 +52,7 @@ public CheckNameAvailabilityRequest withName(String name) { /** * Get the type property: The resource type. - * + * * @return the type value. */ public String type() { @@ -53,7 +61,7 @@ public String type() { /** * Set the type property: The resource type. - * + * * @param type the type value to set. * @return the CheckNameAvailabilityRequest object itself. */ @@ -64,7 +72,7 @@ public CheckNameAvailabilityRequest withType(String type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityResponse.java index 25964f54d42b..7832ec9b971b 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityResponse.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/CheckNameAvailabilityResponse.java @@ -6,32 +6,34 @@ import com.azure.resourcemanager.agrifood.fluent.models.CheckNameAvailabilityResponseInner; -/** An immutable client-side representation of CheckNameAvailabilityResponse. */ +/** + * An immutable client-side representation of CheckNameAvailabilityResponse. + */ public interface CheckNameAvailabilityResponse { /** * Gets the nameAvailable property: Indicates if the resource name is available. - * + * * @return the nameAvailable value. */ Boolean nameAvailable(); /** * Gets the reason property: The reason why the given name is not available. - * + * * @return the reason value. */ CheckNameAvailabilityReason reason(); /** * Gets the message property: Detailed reason why the given name is available. - * + * * @return the message value. */ String message(); /** * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.CheckNameAvailabilityResponseInner object. - * + * * @return the inner object. */ CheckNameAvailabilityResponseInner innerModel(); 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/DataConnectorListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorListResponse.java new file mode 100644 index 000000000000..b326ca9bee34 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorListResponse.java @@ -0,0 +1,92 @@ +// 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.resourcemanager.agrifood.fluent.models.DataConnectorInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 DataConnectorListResponse { + /* + * List of requested objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Continuation link (absolute URI) to the next page of results in the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of DataConnectorListResponse class. + */ + public DataConnectorListResponse() { + } + + /** + * 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 DataConnectorListResponse object itself. + */ + public DataConnectorListResponse 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; + } + + /** + * 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) { + 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); +} 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..fd1d02d2b475 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataConnectorProperties.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataConnector Properties. + */ +@Fluent +public final class DataConnectorProperties { + /* + * AuthCredentials abstract base class for Auth Purpose. + */ + @JsonProperty(value = "credentials", required = true) + 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); +} 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 59% 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 bca08be768ae..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 @@ -5,134 +5,153 @@ package com.azure.resourcemanager.agrifood.models; 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. */ -public interface FarmBeats { +/** + * An immutable client-side representation of DataManagerForAgriculture. + */ +public interface DataManagerForAgriculture { /** * 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 location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the identity property: Identity for the resource. - * + * * @return the identity value. */ Identity identity(); /** - * Gets the instanceUri property: Uri of the FarmBeats instance. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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. */ 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. - * + * 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. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ 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(); - - /** The entirety of the FarmBeats definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + DataManagerForAgricultureInner innerModel(); + + /** + * 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 { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -140,157 +159,186 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the FarmBeats definition allowing to specify parent resource. */ + + /** + * The stage of the DataManagerForAgriculture definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** - * 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 { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithSensorIntegration, DefinitionStages.WithPublicNetworkAccess { /** * Executes the create request. - * + * * @return the created resource. */ - FarmBeats create(); + DataManagerForAgriculture create(); /** * Executes the create request. - * + * * @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 { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the FarmBeats definition allowing to specify identity. */ + + /** + * The stage of the DataManagerForAgriculture definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: Identity for the resource.. - * + * * @param identity Identity for the resource. * @return the next definition stage. */ WithCreate withIdentity(Identity identity); } - /** The stage of the FarmBeats definition allowing to specify sensorIntegration. */ + + /** + * The stage of the DataManagerForAgriculture definition allowing to specify sensorIntegration. + */ interface WithSensorIntegration { /** * Specifies the sensorIntegration property: Sensor integration request model.. - * + * * @param sensorIntegration Sensor integration request model. * @return the next definition stage. */ WithCreate withSensorIntegration(SensorIntegration sensorIntegration); } - /** 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.. - * - * @param publicNetworkAccess 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 Data Manager For + * Agriculture resource. * @return the next definition stage. */ WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); } } + /** - * 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 { /** * Executes the update request. - * + * * @return the updated resource. */ - FarmBeats apply(); + DataManagerForAgriculture apply(); /** * Executes the update request. - * + * * @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 { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the FarmBeats update allowing to specify identity. */ + + /** + * The stage of the DataManagerForAgriculture update allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: Identity for the resource.. - * + * * @param identity Identity for the resource. * @return the next definition stage. */ Update withIdentity(Identity identity); } - /** 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.. - * - * @param properties FarmBeats ARM Resource properties. + * Specifies the properties property: Data Manager For Agriculture 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); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ - FarmBeats refresh(); + DataManagerForAgriculture refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @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..65b6389e4f50 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureExtensionListResponse.java @@ -0,0 +1,119 @@ +// 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.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureExtensionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * List of requested objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Token used in retrieving the next page. If null, there are no additional pages. + */ + @JsonProperty(value = "$skipToken") + private String skipToken; + + /* + * Continuation link (absolute URI) to the next page of results in the list. + */ + @JsonProperty(value = "nextLink") + 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); +} 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 74% 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 a5308cfbc52a..34c1fb0e5f47 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,36 +2,37 @@ // 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.resourcemanager.agrifood.models.DetailedInformation; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** FarmBeatsExtension properties. */ +/** + * DataManagerForAgricultureExtension properties. + */ @Immutable -public final class FarmBeatsExtensionProperties { +public final class DataManagerForAgricultureExtensionProperties { /* - * Target ResourceType of the farmBeatsExtension. + * Target ResourceType of the Data Manager For Agriculture Extension. */ @JsonProperty(value = "targetResourceType", access = JsonProperty.Access.WRITE_ONLY) private String targetResourceType; /* - * FarmBeatsExtension ID. + * Data Manager For Agriculture Extension ID. */ @JsonProperty(value = "farmBeatsExtensionId", access = JsonProperty.Access.WRITE_ONLY) private String farmBeatsExtensionId; /* - * FarmBeatsExtension name. + * Data Manager For Agriculture Extension name. */ @JsonProperty(value = "farmBeatsExtensionName", access = JsonProperty.Access.WRITE_ONLY) private String farmBeatsExtensionName; /* - * FarmBeatsExtension version. + * Data Manager For Agriculture Extension version. */ @JsonProperty(value = "farmBeatsExtensionVersion", access = JsonProperty.Access.WRITE_ONLY) private String farmBeatsExtensionVersion; @@ -55,13 +56,13 @@ public final class FarmBeatsExtensionProperties { private String extensionCategory; /* - * FarmBeatsExtension auth link. + * Data Manager For Agriculture Extension auth link. */ @JsonProperty(value = "extensionAuthLink", access = JsonProperty.Access.WRITE_ONLY) private String extensionAuthLink; /* - * FarmBeatsExtension api docs link. + * Data Manager For Agriculture Extension api docs link. */ @JsonProperty(value = "extensionApiDocsLink", access = JsonProperty.Access.WRITE_ONLY) private String extensionApiDocsLink; @@ -76,8 +77,14 @@ public final class FarmBeatsExtensionProperties { private List detailedInformation; /** - * Get the targetResourceType property: Target ResourceType of the farmBeatsExtension. - * + * Creates an instance of DataManagerForAgricultureExtensionProperties class. + */ + public DataManagerForAgricultureExtensionProperties() { + } + + /** + * Get the targetResourceType property: Target ResourceType of the Data Manager For Agriculture Extension. + * * @return the targetResourceType value. */ public String targetResourceType() { @@ -85,8 +92,8 @@ public String targetResourceType() { } /** - * Get the farmBeatsExtensionId property: FarmBeatsExtension ID. - * + * Get the farmBeatsExtensionId property: Data Manager For Agriculture Extension ID. + * * @return the farmBeatsExtensionId value. */ public String farmBeatsExtensionId() { @@ -94,8 +101,8 @@ public String farmBeatsExtensionId() { } /** - * Get the farmBeatsExtensionName property: FarmBeatsExtension name. - * + * Get the farmBeatsExtensionName property: Data Manager For Agriculture Extension name. + * * @return the farmBeatsExtensionName value. */ public String farmBeatsExtensionName() { @@ -103,8 +110,8 @@ public String farmBeatsExtensionName() { } /** - * Get the farmBeatsExtensionVersion property: FarmBeatsExtension version. - * + * Get the farmBeatsExtensionVersion property: Data Manager For Agriculture Extension version. + * * @return the farmBeatsExtensionVersion value. */ public String farmBeatsExtensionVersion() { @@ -113,7 +120,7 @@ public String farmBeatsExtensionVersion() { /** * Get the publisherId property: Publisher ID. - * + * * @return the publisherId value. */ public String publisherId() { @@ -122,7 +129,7 @@ public String publisherId() { /** * Get the description property: Textual description. - * + * * @return the description value. */ public String description() { @@ -131,7 +138,7 @@ public String description() { /** * Get the extensionCategory property: Category of the extension. e.g. weather/sensor/satellite. - * + * * @return the extensionCategory value. */ public String extensionCategory() { @@ -139,8 +146,8 @@ 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. */ public String extensionAuthLink() { @@ -148,8 +155,8 @@ 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. */ public String extensionApiDocsLink() { @@ -157,10 +164,11 @@ public String 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, + * 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() { @@ -169,7 +177,7 @@ public List detailedInformation() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 52% 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 c1ba7c36c75a..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 @@ -9,59 +9,59 @@ import com.azure.core.util.Context; import java.util.List; -/** Resource collection API of FarmBeatsExtensions. */ -public interface FarmBeatsExtensions { +/** + * Resource collection API of DataManagerForAgricultureExtensions. + */ +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. - * - * @param farmBeatsExtensionIds FarmBeatsExtension ids. - * @param farmBeatsExtensionNames FarmBeats extension names. + * Get list of Data Manager For Agriculture extension. + * + * @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). Minimum = 10, Maximum = 1000, Default value = 50. + * @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 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. - * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. + * Get Data Manager For Agriculture extension. + * + * @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. + * @return data Manager For Agriculture extension along with {@link Response}. */ - FarmBeatsExtension get(String farmBeatsExtensionId); + Response getWithResponse(String dataManagerForAgricultureExtensionId, + Context context); /** - * Get farmBeats extension. - * - * @param farmBeatsExtensionId farmBeatsExtensionId to be queried. - * @param context The context to associate with this operation. + * Get Data Manager For Agriculture extension. + * + * @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 along with {@link Response}. + * @return data Manager For Agriculture extension. */ - Response getWithResponse(String farmBeatsExtensionId, Context context); + DataManagerForAgricultureExtension get(String dataManagerForAgricultureExtensionId); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureListResponse.java new file mode 100644 index 000000000000..d3038419cbf5 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureListResponse.java @@ -0,0 +1,118 @@ +// 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.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 DataManagerForAgricultureListResponse { + /* + * List of requested objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Token used in retrieving the next page. If null, there are no additional pages. + */ + @JsonProperty(value = "$skipToken") + private String skipToken; + + /* + * Continuation link (absolute URI) to the next page of results in the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of DataManagerForAgricultureListResponse class. + */ + public DataManagerForAgricultureListResponse() { + } + + /** + * 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 DataManagerForAgricultureListResponse object itself. + */ + public DataManagerForAgricultureListResponse 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 DataManagerForAgricultureListResponse object itself. + */ + public DataManagerForAgricultureListResponse 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 DataManagerForAgricultureListResponse object itself. + */ + public DataManagerForAgricultureListResponse 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 DataManagerForAgricultureListResponse")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataManagerForAgricultureListResponse.class); +} 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 59% 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 1fc27e9d80c4..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 @@ -8,165 +8,142 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of FarmBeatsModels. */ -public interface FarmBeatsModels { +/** + * Resource collection API of DataManagerForAgricultureResources. + */ +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. + * @return dataManagerForAgriculture resource along with {@link Response}. */ - FarmBeats getByResourceGroup(String resourceGroupName, String farmBeatsResourceName); + 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 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 farmBeats resource along with {@link Response}. + * @return dataManagerForAgriculture resource. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String farmBeatsResourceName, Context context); + 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}. */ - void deleteByResourceGroup(String resourceGroupName, String farmBeatsResourceName); + 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 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 the {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String farmBeatsResourceName, Context context); + 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}. + * paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Lists the FarmBeats instances for a subscription. - * - * @param maxPageSize Maximum number of items needed (inclusive). Minimum = 10, Maximum = 1000, Default value = 50. + * Lists the DataManagerForAgriculture instances for a subscription. + * + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. * @param skipToken Skip 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}. + * 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. * @throws com.azure.core.management.exception.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}. + * 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). Minimum = 10, Maximum = 1000, Default value = 50. + * @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 listByResourceGroup( - String resourceGroupName, Integer maxPageSize, String skipToken, Context context); - - /** - * Get operationResults for a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param operationResultsId The operation results 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 operationResults for a FarmBeats resource. - */ - ArmAsyncOperation getOperationResult( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId); - - /** - * Get operationResults for a FarmBeats resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param operationResultsId The operation results 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 operationResults for a FarmBeats resource along with {@link Response}. + * paginated response with {@link PagedIterable}. */ - Response getOperationResultWithResponse( - String resourceGroupName, String farmBeatsResourceName, String operationResultsId, 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. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -175,8 +152,8 @@ Response getOperationResultWithResponse( 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -187,10 +164,10 @@ Response getOperationResultWithResponse( 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/DataManagerForAgricultureSolution.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolution.java new file mode 100644 index 000000000000..7cb60cb05a96 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolution.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.DataManagerForAgricultureSolutionInner; + +/** + * An immutable client-side representation of DataManagerForAgricultureSolution. + */ +public interface DataManagerForAgricultureSolution { + /** + * 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: DataManagerForAgricultureSolution properties. + * + * @return the properties value. + */ + DataManagerForAgricultureSolutionProperties 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.DataManagerForAgricultureSolutionInner object. + * + * @return the inner object. + */ + 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..948dd61cdd06 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionListResponse.java @@ -0,0 +1,118 @@ +// 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.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureSolutionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * List of requested objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Token used in retrieving the next page. If null, there are no additional pages. + */ + @JsonProperty(value = "$skipToken") + private String skipToken; + + /* + * Continuation link (absolute URI) to the next page of results in the list. + */ + @JsonProperty(value = "nextLink") + 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); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionProperties.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionProperties.java new file mode 100644 index 000000000000..2c4e7d0de28e --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/DataManagerForAgricultureSolutionProperties.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * DataManagerForAgricultureSolution properties. + */ +@Fluent +public final class DataManagerForAgricultureSolutionProperties { + /* + * Solution Partner Id. + */ + @JsonProperty(value = "partnerId", access = JsonProperty.Access.WRITE_ONLY) + private String partnerId; + + /* + * Solution Partner Tenant Id. + */ + @JsonProperty(value = "partnerTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String partnerTenantId; + + /* + * Gets scope of the Data manager For Agriculture data access that's required for processing solution request to partner. + * Example: For gdd they might need weatherScope and satelliteScope. + */ + @JsonProperty(value = "dataAccessScopes", access = JsonProperty.Access.WRITE_ONLY) + private List dataAccessScopes; + + /* + * The marketplaceOfferDetails property. + */ + @JsonProperty(value = "marketplaceOfferDetails") + private MarketplaceOfferDetails marketplaceOfferDetails; + + /* + * Gets api-version Swagger Document Dictionary to capture all api-versions of swagger exposed by partner to Data Manager For Agriculture. + */ + @JsonProperty(value = "openApiSpecsDictionary", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map openApiSpecsDictionary; + + /* + * Application id of the multi tenant application to be used by partner to access Data Manager For Agriculture data. + */ + @JsonProperty(value = "accessFBApplicationId", access = JsonProperty.Access.WRITE_ONLY) + private UUID accessFBApplicationId; + + /* + * Application id of the SaaS multi tenant application. + */ + @JsonProperty(value = "saaSApplicationId", access = JsonProperty.Access.WRITE_ONLY) + private String saaSApplicationId; + + /* + * List of ActionIds needed to make the SaaS multi tenant application access relevant fb data. + */ + @JsonProperty(value = "actionIds", access = JsonProperty.Access.WRITE_ONLY) + private List actionIds; + + /* + * Role Id of the SaaS multi tenant application to access relevant fb data. + */ + @JsonProperty(value = "roleId", access = JsonProperty.Access.WRITE_ONLY) + private String roleId; + + /* + * Role Name of the SaaS multi tenant application to access relevant fb data. + */ + @JsonProperty(value = "roleName", access = JsonProperty.Access.WRITE_ONLY) + private String roleName; + + /* + * Application name of the multi tenant application to be used by partner to access Data Manager For Agriculture Data. + */ + @JsonProperty(value = "accessFBApplicationName", access = JsonProperty.Access.WRITE_ONLY) + private String accessFBApplicationName; + + /** + * Creates an instance of DataManagerForAgricultureSolutionProperties class. + */ + public DataManagerForAgricultureSolutionProperties() { + } + + /** + * Get the partnerId property: Solution Partner Id. + * + * @return the partnerId value. + */ + public String partnerId() { + return this.partnerId; + } + + /** + * Get the partnerTenantId property: Solution Partner Tenant Id. + * + * @return the partnerTenantId value. + */ + public String partnerTenantId() { + return this.partnerTenantId; + } + + /** + * Get the dataAccessScopes property: Gets scope of the Data manager For Agriculture data access that's required for + * processing solution request to partner. + * Example: For gdd they might need weatherScope and satelliteScope. + * + * @return the dataAccessScopes value. + */ + public List dataAccessScopes() { + return this.dataAccessScopes; + } + + /** + * Get the marketplaceOfferDetails property: The marketplaceOfferDetails property. + * + * @return the marketplaceOfferDetails value. + */ + public MarketplaceOfferDetails marketplaceOfferDetails() { + return this.marketplaceOfferDetails; + } + + /** + * Set the marketplaceOfferDetails property: The marketplaceOfferDetails property. + * + * @param marketplaceOfferDetails the marketplaceOfferDetails value to set. + * @return the DataManagerForAgricultureSolutionProperties object itself. + */ + public DataManagerForAgricultureSolutionProperties + withMarketplaceOfferDetails(MarketplaceOfferDetails marketplaceOfferDetails) { + this.marketplaceOfferDetails = marketplaceOfferDetails; + return this; + } + + /** + * 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. + */ + public Map openApiSpecsDictionary() { + return this.openApiSpecsDictionary; + } + + /** + * Get the accessFBApplicationId property: Application id of the multi tenant application to be used by partner to + * access Data Manager For Agriculture data. + * + * @return the accessFBApplicationId value. + */ + public UUID accessFBApplicationId() { + return this.accessFBApplicationId; + } + + /** + * Get the saaSApplicationId property: Application id of the SaaS multi tenant application. + * + * @return the saaSApplicationId value. + */ + public String saaSApplicationId() { + return this.saaSApplicationId; + } + + /** + * Get the actionIds property: List of ActionIds needed to make the SaaS multi tenant application access relevant fb + * data. + * + * @return the actionIds value. + */ + public List actionIds() { + return this.actionIds; + } + + /** + * Get the roleId property: Role Id of the SaaS multi tenant application to access relevant fb data. + * + * @return the roleId value. + */ + public String roleId() { + return this.roleId; + } + + /** + * Get the roleName property: Role Name of the SaaS multi tenant application to access relevant fb data. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Get the accessFBApplicationName property: Application name of the multi tenant application to be used by partner + * to access Data Manager For Agriculture Data. + * + * @return the accessFBApplicationName value. + */ + public String accessFBApplicationName() { + return this.accessFBApplicationName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (marketplaceOfferDetails() != null) { + marketplaceOfferDetails().validate(); + } + } +} 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 64% 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 6b0f2b4d9524..4f8db63c8ad8 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 @@ -7,9 +7,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** FarmBeats ARM Resource properties. */ +/** + * Data Manager For Agriculture ARM Resource properties. + */ @Fluent -public final class FarmBeatsUpdateProperties { +public final class DataManagerForAgricultureUpdateProperties { /* * Sensor integration request model. */ @@ -17,14 +19,20 @@ public final class FarmBeatsUpdateProperties { 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. */ @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; + /** + * Creates an instance of DataManagerForAgricultureUpdateProperties class. + */ + public DataManagerForAgricultureUpdateProperties() { + } + /** * Get the sensorIntegration property: Sensor integration request model. - * + * * @return the sensorIntegration value. */ public SensorIntegration sensorIntegration() { @@ -33,18 +41,19 @@ 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. */ public PublicNetworkAccess publicNetworkAccess() { @@ -52,19 +61,20 @@ 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; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 63% 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 46bda32390f0..b33fddbb88a9 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 @@ -9,9 +9,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** FarmBeats update request. */ +/** + * DataManagerForAgriculture update request. + */ @Fluent -public final class FarmBeatsUpdateRequestModel { +public final class DataManagerForAgricultureUpdateRequestModel { /* * Geo-location where the resource lives. */ @@ -25,10 +27,10 @@ public final class FarmBeatsUpdateRequestModel { private Identity identity; /* - * FarmBeats ARM Resource properties. + * Data Manager For Agriculture ARM Resource properties. */ @JsonProperty(value = "properties") - private FarmBeatsUpdateProperties properties; + private DataManagerForAgricultureUpdateProperties properties; /* * Resource tags. @@ -37,9 +39,15 @@ public final class FarmBeatsUpdateRequestModel { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** + * Creates an instance of DataManagerForAgricultureUpdateRequestModel class. + */ + public DataManagerForAgricultureUpdateRequestModel() { + } + /** * Get the location property: Geo-location where the resource lives. - * + * * @return the location value. */ public String location() { @@ -48,18 +56,18 @@ 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; } /** * Get the identity property: Identity for the resource. - * + * * @return the identity value. */ public Identity identity() { @@ -68,38 +76,39 @@ 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; } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -108,18 +117,18 @@ 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; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 0b7f4a321f96..eea2edd5a20b 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 @@ -8,15 +8,29 @@ import com.fasterxml.jackson.annotation.JsonProperty; 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 { /* - * ApiName available for the farmBeatsExtension. + * ApiName available for the Data Manager For Agriculture Extension. */ @JsonProperty(value = "apiName") private String apiName; + /* + * Extension provider's API documentation link. + */ + @JsonProperty(value = "apiDocsLink") + private String apiDocsLink; + + /* + * Type of Api in Extension. + */ + @JsonProperty(value = "apiType") + private String apiType; + /* * List of customParameters. */ @@ -29,6 +43,12 @@ public final class DetailedInformation { @JsonProperty(value = "platformParameters") private List platformParameters; + /* + * List of defaultParameters. + */ + @JsonProperty(value = "apiDefaultInputParameters") + private List apiDefaultInputParameters; + /* * Unit systems info for the data provider. */ @@ -42,8 +62,14 @@ public final class DetailedInformation { private List apiInputParameters; /** - * Get the apiName property: ApiName available for the farmBeatsExtension. - * + * Creates an instance of DetailedInformation class. + */ + public DetailedInformation() { + } + + /** + * Get the apiName property: ApiName available for the Data Manager For Agriculture Extension. + * * @return the apiName value. */ public String apiName() { @@ -51,8 +77,8 @@ 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. */ @@ -61,9 +87,49 @@ 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. - * + * * @return the customParameters value. */ public List customParameters() { @@ -72,7 +138,7 @@ public List customParameters() { /** * Set the customParameters property: List of customParameters. - * + * * @param customParameters the customParameters value to set. * @return the DetailedInformation object itself. */ @@ -83,7 +149,7 @@ public DetailedInformation withCustomParameters(List customParameters) { /** * Get the platformParameters property: List of platformParameters. - * + * * @return the platformParameters value. */ public List platformParameters() { @@ -92,7 +158,7 @@ public List platformParameters() { /** * Set the platformParameters property: List of platformParameters. - * + * * @param platformParameters the platformParameters value to set. * @return the DetailedInformation object itself. */ @@ -101,9 +167,29 @@ 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. - * + * * @return the unitsSupported value. */ public UnitSystemsInfo unitsSupported() { @@ -112,7 +198,7 @@ public UnitSystemsInfo unitsSupported() { /** * Set the unitsSupported property: Unit systems info for the data provider. - * + * * @param unitsSupported the unitsSupported value to set. * @return the DetailedInformation object itself. */ @@ -123,7 +209,7 @@ public DetailedInformation withUnitsSupported(UnitSystemsInfo unitsSupported) { /** * Get the apiInputParameters property: List of apiInputParameters. - * + * * @return the apiInputParameters value. */ public List apiInputParameters() { @@ -132,7 +218,7 @@ public List apiInputParameters() { /** * Set the apiInputParameters property: List of apiInputParameters. - * + * * @param apiInputParameters the apiInputParameters value to set. * @return the DetailedInformation object itself. */ @@ -143,7 +229,7 @@ public DetailedInformation withApiInputParameters(List apiInputParameter /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 84099704176e..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 @@ -4,77 +4,256 @@ 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.ExtensionInner; +import java.util.Map; -/** An immutable client-side representation of Extension. */ +/** + * An immutable client-side representation of Extension. + */ public interface Extension { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: 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 extensionId property: Extension Id. - * + * * @return the extensionId value. */ String extensionId(); /** * Gets the extensionCategory property: Extension category. e.g. weather/sensor/satellite. - * + * * @return the extensionCategory value. */ String extensionCategory(); /** * Gets the installedExtensionVersion property: Installed extension version. - * + * * @return the installedExtensionVersion value. */ String installedExtensionVersion(); /** * Gets the extensionAuthLink property: Extension auth link. - * + * * @return the extensionAuthLink value. */ String extensionAuthLink(); /** * Gets the extensionApiDocsLink property: Extension api docs link. - * + * * @return the extensionApiDocsLink value. */ String extensionApiDocsLink(); + /** + * Gets the additionalApiProperties property: Additional Api Properties. + * + * @return the additionalApiProperties value. + */ + Map additionalApiProperties(); + + /** + * 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.ExtensionInner object. - * + * * @return the inner object. */ ExtensionInner innerModel(); + + /** + * The entirety of the Extension definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Extension definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Extension definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Extension 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. + */ + WithCreate withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName); + } + + /** + * The stage of the Extension 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.WithExtensionVersion, DefinitionStages.WithAdditionalApiProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Extension create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Extension create(Context context); + } + + /** + * The stage of the Extension definition allowing to specify extensionVersion. + */ + interface WithExtensionVersion { + /** + * Specifies the extensionVersion property: Extension Version.. + * + * @param extensionVersion Extension Version. + * @return the next definition stage. + */ + WithCreate withExtensionVersion(String extensionVersion); + } + + /** + * The stage of the Extension definition allowing to specify additionalApiProperties. + */ + interface WithAdditionalApiProperties { + /** + * Specifies the additionalApiProperties property: Additional Api Properties.. + * + * @param additionalApiProperties Additional Api Properties. + * @return the next definition stage. + */ + WithCreate withAdditionalApiProperties(Map additionalApiProperties); + } + } + + /** + * Begins update for the Extension resource. + * + * @return the stage of resource update. + */ + Extension.Update update(); + + /** + * The template for Extension update. + */ + interface Update extends UpdateStages.WithExtensionVersion, UpdateStages.WithAdditionalApiProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Extension apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Extension apply(Context context); + } + + /** + * The Extension update stages. + */ + interface UpdateStages { + /** + * The stage of the Extension update allowing to specify extensionVersion. + */ + interface WithExtensionVersion { + /** + * Specifies the extensionVersion property: Extension Version.. + * + * @param extensionVersion Extension Version. + * @return the next definition stage. + */ + Update withExtensionVersion(String extensionVersion); + } + + /** + * The stage of the Extension update allowing to specify additionalApiProperties. + */ + interface WithAdditionalApiProperties { + /** + * Specifies the additionalApiProperties property: Additional Api Properties.. + * + * @param additionalApiProperties Additional Api Properties. + * @return the next definition stage. + */ + Update withAdditionalApiProperties(Map additionalApiProperties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Extension refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Extension refresh(Context context); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ExtensionInstallationRequest.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ExtensionInstallationRequest.java new file mode 100644 index 000000000000..2523410c57bb --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ExtensionInstallationRequest.java @@ -0,0 +1,91 @@ +// 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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Extension Installation Request Body. + */ +@Fluent +public final class ExtensionInstallationRequest { + /* + * Extension Version. + */ + @JsonProperty(value = "extensionVersion") + private String extensionVersion; + + /* + * Additional Api Properties. + */ + @JsonProperty(value = "additionalApiProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalApiProperties; + + /** + * Creates an instance of ExtensionInstallationRequest class. + */ + public ExtensionInstallationRequest() { + } + + /** + * Get the extensionVersion property: Extension Version. + * + * @return the extensionVersion value. + */ + public String extensionVersion() { + return this.extensionVersion; + } + + /** + * Set the extensionVersion property: Extension Version. + * + * @param extensionVersion the extensionVersion value to set. + * @return the ExtensionInstallationRequest object itself. + */ + public ExtensionInstallationRequest withExtensionVersion(String extensionVersion) { + this.extensionVersion = extensionVersion; + return this; + } + + /** + * Get the additionalApiProperties property: Additional Api Properties. + * + * @return the additionalApiProperties value. + */ + public Map additionalApiProperties() { + return this.additionalApiProperties; + } + + /** + * Set the additionalApiProperties property: Additional Api Properties. + * + * @param additionalApiProperties the additionalApiProperties value to set. + * @return the ExtensionInstallationRequest object itself. + */ + public ExtensionInstallationRequest + withAdditionalApiProperties(Map additionalApiProperties) { + this.additionalApiProperties = additionalApiProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (additionalApiProperties() != null) { + additionalApiProperties().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} 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 61521c0e1c94..6a1c7353a1e3 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,28 +5,43 @@ package com.azure.resourcemanager.agrifood.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.agrifood.fluent.models.ExtensionInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Paged response contains list of requested objects and a URL link to get the next set of results. */ +/** + * Paged response contains list of requested objects and a URL link to get the next set of results. + */ @Fluent public final class ExtensionListResponse { /* * List of requested objects. */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", required = true) private List value; + /* + * Token used in retrieving the next page. If null, there are no additional pages. + */ + @JsonProperty(value = "$skipToken") + private String skipToken; + /* * Continuation link (absolute URI) to the next page of results in the list. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** + * Creates an instance of ExtensionListResponse class. + */ + public ExtensionListResponse() { + } + /** * Get the value property: List of requested objects. - * + * * @return the value value. */ public List value() { @@ -35,7 +50,7 @@ public List value() { /** * Set the value property: List of requested objects. - * + * * @param value the value value to set. * @return the ExtensionListResponse object itself. */ @@ -44,9 +59,29 @@ 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. - * + * * @return the nextLink value. */ public String nextLink() { @@ -55,12 +90,17 @@ public String nextLink() { /** * 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 ExtensionListResponse")); + } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(ExtensionListResponse.class); } 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 80baa3fcd824..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 @@ -9,152 +9,148 @@ import com.azure.core.util.Context; import java.util.List; -/** Resource collection API of Extensions. */ +/** + * Resource collection API of Extensions. + */ public interface Extensions { /** - * Install extension. - * + * 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. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extension resource. + * @return installed extension details by extension id along with {@link Response}. */ - Extension create(String resourceGroupName, String farmBeatsResourceName, String extensionId); + Response getWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context); /** - * Install extension. - * + * 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. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extension resource along with {@link Response}. + * @return installed extension details by extension id. */ - Response createWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context); + Extension get(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId); /** - * Get installed extension details by extension id. - * + * 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. * @throws com.azure.core.management.exception.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. + * @return the {@link Response}. */ - Extension get(String resourceGroupName, String farmBeatsResourceName, String extensionId); + Response deleteWithResponse(String resourceGroupName, String dataManagerForAgricultureResourceName, + String extensionId, Context context); /** - * Get installed extension details by extension id. - * + * 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. * @throws com.azure.core.management.exception.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 along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context); + void delete(String resourceGroupName, String dataManagerForAgricultureResourceName, String extensionId); /** - * Upgrade to latest extension. - * + * Get installed extensions details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param extensionId Id of extension resource. + * @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 extension resource. + * @return installed extensions details as paginated response with {@link PagedIterable}. */ - Extension update(String resourceGroupName, String farmBeatsResourceName, String extensionId); + PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName); /** - * Upgrade to latest extension. - * + * Get installed extensions details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param extensionId Id of extension resource. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param extensionIds Installed extension ids. + * @param extensionCategories Installed extension categories. + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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 extension resource along with {@link Response}. + * @return installed extensions details as paginated response with {@link PagedIterable}. */ - Response updateWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context); + PagedIterable listByDataManagerForAgriculture(String resourceGroupName, + String dataManagerForAgricultureResourceName, List extensionIds, List extensionCategories, + Integer maxPageSize, String skipToken, Context context); /** - * Uninstall extension. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param extensionId Id of extension resource. + * Get installed extension details by extension id. + * + * @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 installed extension details by extension id along with {@link Response}. */ - void delete(String resourceGroupName, String farmBeatsResourceName, String extensionId); + Extension getById(String id); /** - * Uninstall extension. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param extensionId Id of extension resource. + * Get installed extension details by extension id. + * + * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return installed extension details by extension id along with {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String farmBeatsResourceName, String extensionId, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Get installed extensions details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. + * Uninstall extension. + * + * @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 installed extensions details as paginated response with {@link PagedIterable}. */ - PagedIterable listByFarmBeats(String resourceGroupName, String farmBeatsResourceName); + void deleteById(String id); /** - * Get installed extensions details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param farmBeatsResourceName FarmBeats resource name. - * @param extensionIds Installed extension ids. - * @param extensionCategories Installed extension categories. - * @param maxPageSize Maximum number of items needed (inclusive). Minimum = 10, Maximum = 1000, Default value = 50. - * @param skipToken Skip token for getting next set of results. + * Uninstall extension. + * + * @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 installed extensions details as paginated response with {@link PagedIterable}. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Extension resource. + * + * @param name resource name. + * @return the first stage of the new Extension definition. */ - PagedIterable listByFarmBeats( - String resourceGroupName, - String farmBeatsResourceName, - List extensionIds, - List extensionCategories, - Integer maxPageSize, - String skipToken, - Context context); + Extension.DefinitionStages.Blank define(String name); } 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 d87aa0d6f78e..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtension.java +++ /dev/null @@ -1,119 +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/FarmBeatsExtensionListResponse.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtensionListResponse.java deleted file mode 100644 index 2ae2018caf17..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsExtensionListResponse.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -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 FarmBeatsExtensionListResponse { - /* - * List of requested objects. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Continuation link (absolute URI) to the next page of results in the list. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * 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 FarmBeatsExtensionListResponse object itself. - */ - public FarmBeatsExtensionListResponse 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()); - } - } -} 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 ef77cee6349d..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsListResponse.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -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 { - /* - * List of requested objects. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Continuation link (absolute URI) to the next page of results in the list. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * 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()); - } - } -} 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 a27ee9ef2c23..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/FarmBeatsProperties.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.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/Identity.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Identity.java index 68655c2d2a1d..4710d194b4d0 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Identity.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Identity.java @@ -6,21 +6,24 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; -/** Identity for the resource. */ +/** + * Identity for the resource. + */ @Fluent -public class Identity { +public final class Identity { /* - * The principal ID of resource identity. + * The principal ID of resource identity. The value must be an UUID. */ @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; + private UUID principalId; /* - * The tenant ID of resource. + * The tenant ID of resource. The value must be an UUID. */ @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; + private UUID tenantId; /* * The identity type. @@ -29,26 +32,32 @@ public class Identity { private ResourceIdentityType type; /** - * Get the principalId property: The principal ID of resource identity. - * + * Creates an instance of Identity class. + */ + public Identity() { + } + + /** + * Get the principalId property: The principal ID of resource identity. The value must be an UUID. + * * @return the principalId value. */ - public String principalId() { + public UUID principalId() { return this.principalId; } /** - * Get the tenantId property: The tenant ID of resource. - * + * Get the tenantId property: The tenant ID of resource. The value must be an UUID. + * * @return the tenantId value. */ - public String tenantId() { + public UUID tenantId() { return this.tenantId; } /** * Get the type property: The identity type. - * + * * @return the type value. */ public ResourceIdentityType type() { @@ -57,7 +66,7 @@ public ResourceIdentityType type() { /** * Set the type property: The identity type. - * + * * @param type the type value to set. * @return the Identity object itself. */ @@ -68,7 +77,7 @@ public Identity withType(ResourceIdentityType type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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..04d1de54592e --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/KeyVaultProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the key vault. + */ +@Fluent +public final class KeyVaultProperties { + /* + * Uri of the key vault. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /* + * Name of Key Vault key. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /* + * Version of Key Vault key. + */ + @JsonProperty(value = "keyVersion", required = true) + 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); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/MarketplaceOfferDetails.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/MarketplaceOfferDetails.java new file mode 100644 index 000000000000..a70b58e850be --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/MarketplaceOfferDetails.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The MarketplaceOfferDetails model. + */ +@Fluent +public final class MarketplaceOfferDetails { + /* + * The saasOfferId property. + */ + @JsonProperty(value = "saasOfferId") + private String saasOfferId; + + /* + * The publisherId property. + */ + @JsonProperty(value = "publisherId") + private String publisherId; + + /** + * Creates an instance of MarketplaceOfferDetails class. + */ + public MarketplaceOfferDetails() { + } + + /** + * Get the saasOfferId property: The saasOfferId property. + * + * @return the saasOfferId value. + */ + public String saasOfferId() { + return this.saasOfferId; + } + + /** + * Set the saasOfferId property: The saasOfferId property. + * + * @param saasOfferId the saasOfferId value to set. + * @return the MarketplaceOfferDetails object itself. + */ + public MarketplaceOfferDetails withSaasOfferId(String saasOfferId) { + this.saasOfferId = saasOfferId; + return this; + } + + /** + * Get the publisherId property: The publisherId property. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: The publisherId property. + * + * @param publisherId the publisherId value to set. + * @return the MarketplaceOfferDetails object itself. + */ + public MarketplaceOfferDetails withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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..a5273d22b8d7 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OAuthClientCredentials.java @@ -0,0 +1,119 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * OAuthClientCredentials for clientId clientSecret auth. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = OAuthClientCredentials.class, visible = true) +@JsonTypeName("OAuthClientCredentials") +@Fluent +public final class OAuthClientCredentials extends AuthCredentials { + /* + * Enum for different types of AuthCredentials supported. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AuthCredentialsKind kind = AuthCredentialsKind.OAUTH_CLIENT_CREDENTIALS; + + /* + * ClientId associated with the provider. + */ + @JsonProperty(value = "clientId", required = true) + private String clientId; + + /* + * Properties of the key vault. + */ + @JsonProperty(value = "clientSecret", required = true) + 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() { + super.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); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Operation.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Operation.java index c00185bbf156..43d5da930949 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Operation.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Operation.java @@ -6,12 +6,14 @@ import com.azure.resourcemanager.agrifood.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ String name(); @@ -19,14 +21,14 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the display property: Localized display information for this particular operation. - * + * * @return the display value. */ OperationDisplay display(); @@ -34,7 +36,7 @@ public interface Operation { /** * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ Origin origin(); @@ -42,14 +44,14 @@ public interface Operation { /** * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ ActionType actionType(); /** * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationDisplay.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationDisplay.java index 3799ff35d7a1..faf79385f181 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationDisplay.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationDisplay.java @@ -7,26 +7,25 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Localized display information for this particular operation. */ +/** + * Localized display information for this particular operation. + */ @Immutable public final class OperationDisplay { /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - * Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - * Machine", "Restart Virtual Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; @@ -37,10 +36,16 @@ public final class OperationDisplay { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". - * + * * @return the provider value. */ public String provider() { @@ -50,7 +55,7 @@ public String provider() { /** * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. * "Virtual Machines" or "Job Schedule Collections". - * + * * @return the resource value. */ public String resource() { @@ -60,7 +65,7 @@ public String resource() { /** * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. * "Create or Update Virtual Machine", "Restart Virtual Machine". - * + * * @return the operation value. */ public String operation() { @@ -70,7 +75,7 @@ public String operation() { /** * Get the description property: The short, localized friendly description of the operation; suitable for tool tips * and detailed views. - * + * * @return the description value. */ public String description() { @@ -79,7 +84,7 @@ public String description() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationListResult.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationListResult.java index e5078ee84810..76b1e9b9ce0a 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationListResult.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationListResult.java @@ -27,9 +27,15 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + /** * Get the value property: List of operations supported by the resource provider. - * + * * @return the value value. */ public List value() { @@ -38,7 +44,7 @@ public List value() { /** * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * + * * @return the nextLink value. */ public String nextLink() { @@ -47,7 +53,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 000000000000..78db8100a178 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/OperationResults.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OperationResults. + */ +public interface OperationResults { + /** + * Get operationResults for a Data Manager For Agriculture resource. + * + * @param locations Location. + * @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 Data Manager For Agriculture resource along with {@link Response}. + */ + Response getWithResponse(String locations, String operationResultsId, Context context); + + /** + * Get operationResults for a Data Manager For Agriculture resource. + * + * @param locations Location. + * @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 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/Operations.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Operations.java index 0376aa837c50..31ab6242d777 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Operations.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Operations.java @@ -7,27 +7,29 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * Lists the available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * Lists the available operations of Microsoft.AgFoodPlatform resource provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Origin.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Origin.java index 77dc3a14360d..6cd98293efb5 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Origin.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Origin.java @@ -13,18 +13,33 @@ * is "user,system". */ public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ + /** + * Static value user for Origin. + */ public static final Origin USER = fromString("user"); - /** Static value system for Origin. */ + /** + * Static value system for Origin. + */ public static final Origin SYSTEM = fromString("system"); - /** Static value user,system for Origin. */ + /** + * Static value user,system for Origin. + */ public static final Origin USER_SYSTEM = fromString("user,system"); + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + /** * Creates or finds a Origin from its string representation. - * + * * @param name a name to look for. * @return the corresponding Origin. */ @@ -35,7 +50,7 @@ public static Origin fromString(String name) { /** * Gets known Origin values. - * + * * @return known Origin values. */ public static Collection values() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpoint.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpoint.java index 60d6ca43e365..e3c867557d43 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpoint.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpoint.java @@ -7,18 +7,26 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Private Endpoint resource. */ +/** + * The private endpoint resource. + */ @Immutable public final class PrivateEndpoint { /* - * The ARM identifier for Private Endpoint + * The ARM identifier for private endpoint. */ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /** - * Get the id property: The ARM identifier for Private Endpoint. - * + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for private endpoint. + * * @return the id value. */ public String id() { @@ -27,7 +35,7 @@ public String id() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 349877bceac9..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 @@ -7,40 +7,50 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; +import java.util.List; -/** An immutable client-side representation of PrivateEndpointConnection. */ +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ public interface PrivateEndpointConnection { /** * 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 privateEndpoint property: The resource of private end point. - * + * Gets the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the privateEndpoint property: The private endpoint resource. + * * @return the privateEndpoint value. */ PrivateEndpoint privateEndpoint(); @@ -48,52 +58,63 @@ public interface PrivateEndpointConnection { /** * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the * connection between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); /** * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. - * + * * @return the provisioningState value. */ PrivateEndpointConnectionProvisioningState provisioningState(); /** * 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.PrivateEndpointConnectionInner object. - * + * * @return the inner object. */ PrivateEndpointConnectionInner innerModel(); - /** The entirety of the PrivateEndpointConnection definition. */ + /** + * The entirety of the PrivateEndpointConnection definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The PrivateEndpointConnection definition stages. */ + + /** + * The PrivateEndpointConnection definition stages. + */ interface DefinitionStages { - /** The first stage of the PrivateEndpointConnection definition. */ + /** + * The first stage of the PrivateEndpointConnection definition. + */ interface Blank extends WithParentResource { } - /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. + */ 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); } + /** * The stage of the PrivateEndpointConnection 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. @@ -102,29 +123,33 @@ interface WithCreate extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { /** * Executes the create request. - * + * * @return the created resource. */ PrivateEndpointConnection create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ PrivateEndpointConnection create(Context context); } - /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. + */ interface WithPrivateEndpoint { /** - * Specifies the privateEndpoint property: The resource of private end point.. - * - * @param privateEndpoint The resource of private end point. + * Specifies the privateEndpoint property: The private endpoint resource.. + * + * @param privateEndpoint The private endpoint resource. * @return the next definition stage. */ WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); } + /** * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. */ @@ -132,75 +157,87 @@ interface WithPrivateLinkServiceConnectionState { /** * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of * the connection between service consumer and provider.. - * + * * @param privateLinkServiceConnectionState A collection of information about the state of the connection - * between service consumer and provider. + * between service consumer and provider. * @return the next definition stage. */ WithCreate withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } } + /** * Begins update for the PrivateEndpointConnection resource. - * + * * @return the stage of resource update. */ PrivateEndpointConnection.Update update(); - /** The template for PrivateEndpointConnection update. */ + /** + * The template for PrivateEndpointConnection update. + */ interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { /** * Executes the update request. - * + * * @return the updated resource. */ PrivateEndpointConnection apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ PrivateEndpointConnection apply(Context context); } - /** The PrivateEndpointConnection update stages. */ + + /** + * The PrivateEndpointConnection update stages. + */ interface UpdateStages { - /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. + */ interface WithPrivateEndpoint { /** - * Specifies the privateEndpoint property: The resource of private end point.. - * - * @param privateEndpoint The resource of private end point. + * Specifies the privateEndpoint property: The private endpoint resource.. + * + * @param privateEndpoint The private endpoint resource. * @return the next definition stage. */ Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); } - /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. + */ interface WithPrivateLinkServiceConnectionState { /** * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of * the connection between service consumer and provider.. - * + * * @param privateLinkServiceConnectionState A collection of information about the state of the connection - * between service consumer and provider. + * between service consumer and provider. * @return the next definition stage. */ Update withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ PrivateEndpointConnection refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ 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 9e0e64d79273..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,48 +4,24 @@ package com.azure.resourcemanager.agrifood.models; -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionListResultInner; import java.util.List; -/** List of private endpoint connection associated with the specified storage account. */ -@Fluent -public final class PrivateEndpointConnectionListResult { - /* - * Array of private endpoint connections - */ - @JsonProperty(value = "value") - private List value; - +/** + * An immutable client-side representation of 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. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionListResultInner object. + * + * @return the inner object. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } + PrivateEndpointConnectionListResultInner innerModel(); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnectionProvisioningState.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnectionProvisioningState.java index 6ac06b3a9d15..108ab54f245c 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointConnectionProvisioningState.java @@ -8,24 +8,43 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current provisioning state. */ +/** + * The current provisioning state. + */ public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Creating for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Failed for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + /** * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding PrivateEndpointConnectionProvisioningState. */ @@ -36,7 +55,7 @@ public static PrivateEndpointConnectionProvisioningState fromString(String name) /** * Gets known PrivateEndpointConnectionProvisioningState values. - * + * * @return known PrivateEndpointConnectionProvisioningState values. */ public static Collection values() { 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 8b34f8e7277c..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,99 +4,108 @@ 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 PrivateEndpointConnections. */ +/** + * Resource collection API of PrivateEndpointConnections. + */ 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. * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection object. + * @return private endpoint connection object along with {@link Response}. */ - PrivateEndpointConnection get( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName); + 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. - * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection object along with {@link Response}. + * @return private endpoint connection object. */ - Response getWithResponse( - String resourceGroupName, String farmBeatsResourceName, String privateEndpointConnectionName, Context context); + 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. - * + * * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection object along with {@link Response}. */ @@ -104,11 +113,13 @@ PagedIterable listByResource( /** * Get Private endpoint connection object. - * + * * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection object along with {@link Response}. */ @@ -116,7 +127,7 @@ PagedIterable listByResource( /** * Delete Private endpoint connection request. - * + * * @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. @@ -126,7 +137,7 @@ PagedIterable listByResource( /** * Delete Private endpoint connection request. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,7 +148,7 @@ PagedIterable listByResource( /** * Begins definition for a new PrivateEndpointConnection resource. - * + * * @param name resource name. * @return the first stage of the new PrivateEndpointConnection definition. */ diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointServiceConnectionStatus.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointServiceConnectionStatus.java index f553c6a6f927..46d496412ec5 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateEndpointServiceConnectionStatus.java @@ -8,21 +8,38 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The private endpoint connection status. */ +/** + * The private endpoint connection status. + */ public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { - /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Pending for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Approved for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Rejected for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + /** * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding PrivateEndpointServiceConnectionStatus. */ @@ -33,7 +50,7 @@ public static PrivateEndpointServiceConnectionStatus fromString(String name) { /** * Gets known PrivateEndpointServiceConnectionStatus values. - * + * * @return known PrivateEndpointServiceConnectionStatus values. */ public static Collection values() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResource.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResource.java index 9a1f64a1e21d..86f2929c7927 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResource.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkResource.java @@ -8,60 +8,62 @@ import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner; import java.util.List; -/** An immutable client-side representation of PrivateLinkResource. */ +/** + * An immutable client-side representation of PrivateLinkResource. + */ public interface PrivateLinkResource { /** * 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 groupId property: The private link resource group id. - * + * * @return the groupId value. */ String groupId(); /** * Gets the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ List requiredMembers(); /** - * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * Gets the requiredZoneNames property: The private link resource private link DNS zone name. + * * @return the requiredZoneNames value. */ List requiredZoneNames(); /** * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner object. - * + * * @return the inner object. */ PrivateLinkResourceInner innerModel(); 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 f11cebc09995..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,48 +4,24 @@ package com.azure.resourcemanager.agrifood.models; -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceListResultInner; import java.util.List; -/** A list of private link resources. */ -@Fluent -public final class PrivateLinkResourceListResult { - /* - * Array of private link resources - */ - @JsonProperty(value = "value") - private List value; - +/** + * An immutable client-side representation of 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. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * Gets the inner com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceListResultInner object. + * + * @return the inner object. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } + 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 d4e5ddd6992b..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,63 +4,70 @@ 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 PrivateLinkResources. */ +/** + * Resource collection API of PrivateLinkResources. + */ 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. * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private link resource object. + * @return private link resource object along with {@link Response}. */ - PrivateLinkResource get(String resourceGroupName, String farmBeatsResourceName, String subResourceName); + 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. - * @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 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private link resource object along with {@link Response}. + * @return private link resource object. */ - Response getWithResponse( - String resourceGroupName, String farmBeatsResourceName, String subResourceName, Context context); + PrivateLinkResource get(String resourceGroupName, String dataManagerForAgricultureResourceName, + String subResourceName); } diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkServiceConnectionState.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkServiceConnectionState.java index 630be2335219..6fb8f3aa5b19 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkServiceConnectionState.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PrivateLinkServiceConnectionState.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** A collection of information about the state of the connection between service consumer and provider. */ +/** + * A collection of information about the state of the connection between service consumer and provider. + */ @Fluent public final class PrivateLinkServiceConnectionState { /* @@ -28,10 +30,16 @@ public final class PrivateLinkServiceConnectionState { @JsonProperty(value = "actionsRequired") private String actionsRequired; + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + /** * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @return the status value. */ public PrivateEndpointServiceConnectionStatus status() { @@ -41,7 +49,7 @@ public PrivateEndpointServiceConnectionStatus status() { /** * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @param status the status value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -52,7 +60,7 @@ public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnec /** * Get the description property: The reason for approval/rejection of the connection. - * + * * @return the description value. */ public String description() { @@ -61,7 +69,7 @@ public String description() { /** * Set the description property: The reason for approval/rejection of the connection. - * + * * @param description the description value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -73,7 +81,7 @@ public PrivateLinkServiceConnectionState withDescription(String description) { /** * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @return the actionsRequired value. */ public String actionsRequired() { @@ -83,7 +91,7 @@ public String actionsRequired() { /** * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @param actionsRequired the actionsRequired value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -94,7 +102,7 @@ public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 f28ecc2ba5e2..449047fdb748 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,26 +8,52 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Sensor integration instance provisioning state. */ +/** + * Data Manager For Agriculture instance provisioning state. + */ public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Creating for ProvisioningState. */ + /** + * Static value Creating for ProvisioningState. + */ public static final ProvisioningState CREATING = fromString("Creating"); - /** Static value Updating for ProvisioningState. */ + /** + * Static value Updating for ProvisioningState. + */ public static final ProvisioningState UPDATING = fromString("Updating"); - /** Static value Deleting for ProvisioningState. */ + /** + * Static value Deleting for ProvisioningState. + */ public static final ProvisioningState DELETING = fromString("Deleting"); - /** Static value Succeeded for ProvisioningState. */ + /** + * Static value Succeeded for ProvisioningState. + */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ProvisioningState. */ + /** + * Static value Failed for ProvisioningState. + */ public static final ProvisioningState FAILED = fromString("Failed"); + /** + * Static value Running for ProvisioningState. + */ + public static final ProvisioningState RUNNING = fromString("Running"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + /** * Creates or finds a ProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningState. */ @@ -38,7 +64,7 @@ public static ProvisioningState fromString(String name) { /** * Gets known ProvisioningState values. - * + * * @return known ProvisioningState values. */ public static Collection values() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PublicNetworkAccess.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PublicNetworkAccess.java index c0f42b5c81a0..682482c9df98 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PublicNetworkAccess.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/PublicNetworkAccess.java @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** 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. + */ public final class PublicNetworkAccess extends ExpandableStringEnum { - /** Static value Enabled for PublicNetworkAccess. */ + /** + * Static value Enabled for PublicNetworkAccess. + */ public static final PublicNetworkAccess ENABLED = fromString("Enabled"); - /** Static value Hybrid for PublicNetworkAccess. */ - public static final PublicNetworkAccess HYBRID = fromString("Hybrid"); + /** + * Static value Disabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } /** * Creates or finds a PublicNetworkAccess from its string representation. - * + * * @param name a name to look for. * @return the corresponding PublicNetworkAccess. */ @@ -29,7 +44,7 @@ public static PublicNetworkAccess fromString(String name) { /** * Gets known PublicNetworkAccess values. - * + * * @return known PublicNetworkAccess values. */ public static Collection values() { diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ResourceIdentityType.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ResourceIdentityType.java index fa1cbc9510b4..3f0d6cef2b5a 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ResourceIdentityType.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/ResourceIdentityType.java @@ -7,12 +7,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The identity type. */ +/** + * The identity type. + */ public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ + /** + * Enum value SystemAssigned. + */ SYSTEM_ASSIGNED("SystemAssigned"); - /** The actual serialized value for a ResourceIdentityType instance. */ + /** + * The actual serialized value for a ResourceIdentityType instance. + */ private final String value; ResourceIdentityType(String value) { @@ -21,7 +27,7 @@ public enum ResourceIdentityType { /** * Parses a serialized value to a ResourceIdentityType instance. - * + * * @param value the serialized value to parse. * @return the parsed ResourceIdentityType object, or null if unable to parse. */ @@ -39,7 +45,9 @@ public static ResourceIdentityType fromString(String value) { return null; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @JsonValue @Override public String toString() { 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 b0059797b5b2..9ab9cfb3c6a2 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 @@ -8,11 +8,13 @@ import com.azure.core.management.exception.ManagementError; import com.fasterxml.jackson.annotation.JsonProperty; -/** Sensor integration request model. */ +/** + * Sensor integration request model. + */ @Fluent public final class SensorIntegration { /* - * Sensor integration enable state. Allowed values are True, None + * Sensor integration enable state. */ @JsonProperty(value = "enabled") private String enabled; @@ -25,16 +27,21 @@ public final class SensorIntegration { /* * Error response - * - * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This - * also follows the OData error response format.). + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ @JsonProperty(value = "provisioningInfo") private ManagementError provisioningInfo; /** - * Get the enabled property: Sensor integration enable state. Allowed values are True, None. - * + * Creates an instance of SensorIntegration class. + */ + public SensorIntegration() { + } + + /** + * Get the enabled property: Sensor integration enable state. + * * @return the enabled value. */ public String enabled() { @@ -42,8 +49,8 @@ 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. */ @@ -54,7 +61,7 @@ public SensorIntegration withEnabled(String enabled) { /** * Get the provisioningState property: Sensor integration instance provisioning state. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -63,10 +70,10 @@ public ProvisioningState provisioningState() { /** * Get the provisioningInfo property: Error response - * - *

Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This * also follows the OData error response format.). - * + * * @return the provisioningInfo value. */ public ManagementError provisioningInfo() { @@ -75,10 +82,10 @@ public ManagementError provisioningInfo() { /** * Set the provisioningInfo property: Error response - * - *

Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This * also follows the OData error response format.). - * + * * @param provisioningInfo the provisioningInfo value to set. * @return the SensorIntegration object itself. */ @@ -89,7 +96,7 @@ public SensorIntegration withProvisioningInfo(ManagementError provisioningInfo) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 000000000000..d6b60bbdb3ea --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solution.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.SolutionInner; + +/** + * An immutable client-side representation of Solution. + */ +public interface Solution { + /** + * 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: Solution resource properties. + * + * @return the properties value. + */ + SolutionProperties 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.SolutionInner object. + * + * @return the inner object. + */ + SolutionInner innerModel(); + + /** + * The entirety of the Solution definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Solution definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Solution definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Solution 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. + */ + WithCreate withExistingFarmBeat(String resourceGroupName, String dataManagerForAgricultureResourceName); + } + + /** + * The stage of the Solution 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Solution create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Solution create(Context context); + } + + /** + * The stage of the Solution definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Solution resource properties.. + * + * @param properties Solution resource properties. + * @return the next definition stage. + */ + WithCreate withProperties(SolutionProperties properties); + } + } + + /** + * Begins update for the Solution resource. + * + * @return the stage of resource update. + */ + Solution.Update update(); + + /** + * The template for Solution update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Solution apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Solution apply(Context context); + } + + /** + * The Solution update stages. + */ + interface UpdateStages { + /** + * The stage of the Solution update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Solution resource properties.. + * + * @param properties Solution resource properties. + * @return the next definition stage. + */ + Update withProperties(SolutionProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Solution refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Solution refresh(Context context); +} 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 new file mode 100644 index 000000000000..2c35be7026ad --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionListResponse.java @@ -0,0 +1,117 @@ +// 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.resourcemanager.agrifood.fluent.models.SolutionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 SolutionListResponse { + /* + * List of requested objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Token used in retrieving the next page. If null, there are no additional pages. + */ + @JsonProperty(value = "$skipToken") + private String skipToken; + + /* + * Continuation link (absolute URI) to the next page of results in the list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of SolutionListResponse class. + */ + public SolutionListResponse() { + } + + /** + * 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 SolutionListResponse object itself. + */ + public SolutionListResponse 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 SolutionListResponse object itself. + */ + public SolutionListResponse 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 SolutionListResponse object itself. + */ + public SolutionListResponse 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 SolutionListResponse")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SolutionListResponse.class); +} 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 new file mode 100644 index 000000000000..34469cc331f4 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionProperties.java @@ -0,0 +1,295 @@ +// 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.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** + * Solution resource properties. + */ +@Fluent +public final class SolutionProperties { + /* + * Partner Id of the Solution. + */ + @JsonProperty(value = "partnerId", access = JsonProperty.Access.WRITE_ONLY) + private String partnerId; + + /* + * SaaS subscriptionId of the installed SaaS application. + */ + @JsonProperty(value = "saasSubscriptionId", required = true) + private String saasSubscriptionId; + + /* + * SaaS subscription name of the installed SaaS application. + */ + @JsonProperty(value = "saasSubscriptionName", required = true) + private String saasSubscriptionName; + + /* + * SaaS application Marketplace Publisher Id. + */ + @JsonProperty(value = "marketplacePublisherId", required = true) + private String marketplacePublisherId; + + /* + * SaaS application Plan Id. + */ + @JsonProperty(value = "planId", required = true) + private String planId; + + /* + * Role Assignment Id. + */ + @JsonProperty(value = "roleAssignmentId") + private String roleAssignmentId; + + /* + * SaaS application Offer Id. + */ + @JsonProperty(value = "offerId", required = true) + private String offerId; + + /* + * SaaS application Term Id. + */ + @JsonProperty(value = "termId", required = true) + private String termId; + + /* + * Solution resource properties. + */ + @JsonIgnore + private Map additionalProperties; + + /** + * Creates an instance of SolutionProperties class. + */ + public SolutionProperties() { + } + + /** + * Get the partnerId property: Partner Id of the Solution. + * + * @return the partnerId value. + */ + public String partnerId() { + return this.partnerId; + } + + /** + * Get the saasSubscriptionId property: SaaS subscriptionId of the installed SaaS application. + * + * @return the saasSubscriptionId value. + */ + public String saasSubscriptionId() { + return this.saasSubscriptionId; + } + + /** + * Set the saasSubscriptionId property: SaaS subscriptionId of the installed SaaS application. + * + * @param saasSubscriptionId the saasSubscriptionId value to set. + * @return the SolutionProperties object itself. + */ + public SolutionProperties withSaasSubscriptionId(String saasSubscriptionId) { + this.saasSubscriptionId = saasSubscriptionId; + return this; + } + + /** + * Get the saasSubscriptionName property: SaaS subscription name of the installed SaaS application. + * + * @return the saasSubscriptionName value. + */ + public String saasSubscriptionName() { + return this.saasSubscriptionName; + } + + /** + * Set the saasSubscriptionName property: SaaS subscription name of the installed SaaS application. + * + * @param saasSubscriptionName the saasSubscriptionName value to set. + * @return the SolutionProperties object itself. + */ + public SolutionProperties withSaasSubscriptionName(String saasSubscriptionName) { + this.saasSubscriptionName = saasSubscriptionName; + return this; + } + + /** + * Get the marketplacePublisherId property: SaaS application Marketplace Publisher Id. + * + * @return the marketplacePublisherId value. + */ + public String marketplacePublisherId() { + return this.marketplacePublisherId; + } + + /** + * Set the marketplacePublisherId property: SaaS application Marketplace Publisher Id. + * + * @param marketplacePublisherId the marketplacePublisherId value to set. + * @return the SolutionProperties object itself. + */ + public SolutionProperties withMarketplacePublisherId(String marketplacePublisherId) { + this.marketplacePublisherId = marketplacePublisherId; + return this; + } + + /** + * Get the planId property: SaaS application Plan Id. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: SaaS application Plan Id. + * + * @param planId the planId value to set. + * @return the SolutionProperties object itself. + */ + public SolutionProperties withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the roleAssignmentId property: Role Assignment Id. + * + * @return the roleAssignmentId value. + */ + public String roleAssignmentId() { + return this.roleAssignmentId; + } + + /** + * Set the roleAssignmentId property: Role Assignment Id. + * + * @param roleAssignmentId the roleAssignmentId value to set. + * @return the SolutionProperties object itself. + */ + public SolutionProperties withRoleAssignmentId(String roleAssignmentId) { + this.roleAssignmentId = roleAssignmentId; + return this; + } + + /** + * Get the offerId property: SaaS application Offer Id. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Set the offerId property: SaaS application Offer Id. + * + * @param offerId the offerId value to set. + * @return the SolutionProperties object itself. + */ + public SolutionProperties withOfferId(String offerId) { + this.offerId = offerId; + return this; + } + + /** + * Get the termId property: SaaS application Term Id. + * + * @return the termId value. + */ + public String termId() { + return this.termId; + } + + /** + * Set the termId property: SaaS application Term Id. + * + * @param termId the termId value to set. + * @return the SolutionProperties object itself. + */ + public SolutionProperties withTermId(String termId) { + this.termId = termId; + return this; + } + + /** + * Get the additionalProperties property: Solution resource properties. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Solution resource properties. + * + * @param additionalProperties the additionalProperties value to set. + * @return the SolutionProperties object itself. + */ + public SolutionProperties withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (saasSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property saasSubscriptionId in model SolutionProperties")); + } + if (saasSubscriptionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property saasSubscriptionName in model SolutionProperties")); + } + if (marketplacePublisherId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property marketplacePublisherId in model SolutionProperties")); + } + if (planId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property planId in model SolutionProperties")); + } + if (offerId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property offerId in model SolutionProperties")); + } + if (termId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property termId in model SolutionProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SolutionProperties.class); +} 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 new file mode 100644 index 000000000000..57fcb00e85fa --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/Solutions.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Resource collection API of Solutions. + */ +public interface Solutions { + /** + * Get installed Solution details by Solution id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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 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 dataManagerForAgricultureResourceName, String solutionId); + + /** + * Uninstall Solution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 dataManagerForAgricultureResourceName, + String solutionId, Context context); + + /** + * Uninstall Solution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 dataManagerForAgricultureResourceName, String solutionId); + + /** + * Get installed Solutions details. + * + * @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 installed Solutions details as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String dataManagerForAgricultureResourceName); + + /** + * Get installed Solutions details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataManagerForAgricultureResourceName DataManagerForAgriculture resource name. + * @param solutionIds Installed Solution ids. + * @param ids Ids of the resource. + * @param names Names of the resource. + * @param propertyFilters Filters on key-value pairs within the Properties object. + * eg. "{testKey} eq {testValue}". + * @param statuses Statuses of the resource. + * @param minCreatedDateTime Minimum creation date of resource (inclusive). + * @param maxCreatedDateTime Maximum creation date of resource (inclusive). + * @param minLastModifiedDateTime Minimum last modified date of resource (inclusive). + * @param maxLastModifiedDateTime Maximum last modified date of resource (inclusive). + * @param maxPageSize Maximum number of items needed (inclusive). + * Minimum = 10, Maximum = 1000, Default value = 50. + * @param skipToken Skip 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 installed Solutions details as paginated response with {@link PagedIterable}. + */ + 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. + * + * @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 installed Solution details by Solution id along with {@link Response}. + */ + Solution getById(String id); + + /** + * Get installed Solution details by Solution id. + * + * @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 installed Solution details by Solution id along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Uninstall Solution. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Uninstall Solution. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Solution resource. + * + * @param name resource name. + * @return the first stage of the new Solution definition. + */ + Solution.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 000000000000..461cf6c6a4b4 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/SolutionsDiscoverabilities.java @@ -0,0 +1,65 @@ +// 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; +import java.util.List; + +/** + * Resource collection API of SolutionsDiscoverabilities. + */ +public interface SolutionsDiscoverabilities { + /** + * 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 Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get list of Data Manager For Agriculture solutions. + * + * @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 Data Manager For Agriculture solutions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(List farmBeatsSolutionIds, + List farmBeatsSolutionNames, Integer maxPageSize, Context context); + + /** + * Get Data Manager For Agriculture solution by id. + * + * @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 data Manager For Agriculture solution by id along with {@link Response}. + */ + Response getWithResponse(String dataManagerForAgricultureSolutionId, + Context context); + + /** + * Get Data Manager For Agriculture solution by id. + * + * @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 data Manager For Agriculture solution by id. + */ + DataManagerForAgricultureSolution get(String dataManagerForAgricultureSolutionId); +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/UnitSystemsInfo.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/UnitSystemsInfo.java index efaff9f97172..e7ca42eeacf3 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/UnitSystemsInfo.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/com/azure/resourcemanager/agrifood/models/UnitSystemsInfo.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Unit systems info for the data provider. */ +/** + * Unit systems info for the data provider. + */ @Fluent public final class UnitSystemsInfo { /* @@ -24,9 +26,15 @@ public final class UnitSystemsInfo { @JsonProperty(value = "values", required = true) private List values; + /** + * Creates an instance of UnitSystemsInfo class. + */ + public UnitSystemsInfo() { + } + /** * Get the key property: UnitSystem key sent as part of ProviderInput. - * + * * @return the key value. */ public String key() { @@ -35,7 +43,7 @@ public String key() { /** * Set the key property: UnitSystem key sent as part of ProviderInput. - * + * * @param key the key value to set. * @return the UnitSystemsInfo object itself. */ @@ -46,7 +54,7 @@ public UnitSystemsInfo withKey(String key) { /** * Get the values property: List of unit systems supported by this data provider. - * + * * @return the values value. */ public List values() { @@ -55,7 +63,7 @@ public List values() { /** * Set the values property: List of unit systems supported by this data provider. - * + * * @param values the values value to set. * @return the UnitSystemsInfo object itself. */ @@ -66,19 +74,17 @@ public UnitSystemsInfo withValues(List values) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (key() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property key in model UnitSystemsInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property key in model UnitSystemsInfo")); } if (values() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property values in model UnitSystemsInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property values in model UnitSystemsInfo")); } } 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 7c531ef039b4..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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for AgriFoodManagementClient. APIs documentation for Azure AgFoodPlatform Resource - * Provider Service. + * Package containing the data models for AgriFoodManagementClient. + * 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 6331f4d2b432..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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for AgriFoodManagementClient. APIs documentation for Azure AgFoodPlatform Resource - * Provider Service. + * Package containing the classes for AgriFoodManagementClient. + * 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/java/module-info.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/module-info.java index 5e7c732744b7..cebd99760c01 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/module-info.java +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.agrifood { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.agrifood; exports com.azure.resourcemanager.agrifood.fluent; exports com.azure.resourcemanager.agrifood.fluent.models; exports com.azure.resourcemanager.agrifood.models; - - opens com.azure.resourcemanager.agrifood.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.agrifood.models to - com.azure.core, - com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.agrifood.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.agrifood.models to com.azure.core, com.fasterxml.jackson.databind; +} \ No newline at end of file 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 new file mode 100644 index 000000000000..7b7913abfa11 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/proxy-config.json @@ -0,0 +1 @@ +[ [ "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.OperationResultsClientImpl$OperationResultsService" ], [ "com.azure.resourcemanager.agrifood.implementation.ExtensionsClientImpl$ExtensionsService" ], [ "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/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/reflect-config.json b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/reflect-config.json new file mode 100644 index 000000000000..57a4d86bf8bf --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-agrifood/reflect-config.json @@ -0,0 +1,276 @@ +[ { + "name" : "com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.CheckNameAvailabilityResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.DataConnectorInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.AuthCredentials", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DataConnectorListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureExtensionListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureExtensionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureExtensionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DetailedInformation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.UnitSystemsInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.Identity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.SensorIntegration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.PrivateEndpoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureUpdateRequestModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.ArmAsyncOperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.ArmAsyncOperationError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.ExtensionInstallationRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.ApiProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.ExtensionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.ExtensionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.ExtensionListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.PrivateEndpointConnectionListResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceListResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.PrivateLinkResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.SolutionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.SolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.SolutionListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureSolutionListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.fluent.models.DataManagerForAgricultureSolutionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.DataManagerForAgricultureSolutionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.MarketplaceOfferDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.ApiKeyAuthCredentials", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.KeyVaultProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.OAuthClientCredentials", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityReason", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.AuthCredentialsKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.PublicNetworkAccess", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.PrivateEndpointConnectionProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.agrifood.models.ResourceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityCheckNameAvailabilitySamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..fcf269d377c8 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityCheckNameAvailabilitySamples.java @@ -0,0 +1,42 @@ +// 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.CheckNameAvailabilityRequest; + +/** + * Samples for CheckNameAvailability CheckNameAvailability. + */ +public final class CheckNameAvailabilityCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/CheckNameAvailability_CheckNameAvailability_AlreadyExists.json + */ + /** + * Sample code: CheckNameAvailability_CheckNameAvailability_AlreadyExists. + * + * @param manager Entry point to AgriFoodManager. + */ + 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/2023-06-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); + } +} 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..7dd798ddedc7 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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/2023-06-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..c70bba2bdb63 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataConnectors Delete. + */ +public final class DataConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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/DataConnectorsGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsGetSamples.java new file mode 100644 index 000000000000..49e7e881ccce --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataConnectors Get. + */ +public final class DataConnectorsGetSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/DataConnectors_Get.json + */ + /** + * Sample code: DataConnectors_Get. + * + * @param manager Entry point to AgriFoodManager. + */ + 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/DataConnectorsListSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsListSamples.java new file mode 100644 index 000000000000..0c707fba2d6c --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataConnectorsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataConnectors List. + */ +public final class DataConnectorsListSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/DataConnectors_List.json + */ + /** + * Sample code: DataConnectors_List. + * + * @param manager Entry point to AgriFoodManager. + */ + 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..6fb56098ac5e --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureExtensions Get. + */ +public final class DataManagerForAgricultureExtensionsGetSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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..615a4f5bcd4d --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureExtensionsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureExtensions List. + */ +public final class DataManagerForAgricultureExtensionsListSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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 58% 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 28c18edfbcb3..18c47f10c7b1 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 @@ -7,26 +7,29 @@ import java.util.HashMap; import java.util.Map; -/** Samples for FarmBeatsModels CreateOrUpdate. */ -public final class FarmBeatsModelsCreateOrUpdateSamples { +/** + * Samples for DataManagerForAgricultureResources CreateOrUpdate. + */ +public final class DataManagerForAgricultureResourcesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_CreateOrUpdate.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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") - .withTags(mapOf("key1", "value1", "key2", "value2")) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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..9d4286abd451 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesDeleteSamples.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 Delete. + */ +public final class DataManagerForAgricultureResourcesDeleteSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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..e0e9265ae11e --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesGetByResourceGroupSamples.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 GetByResourceGroup. + */ +public final class DataManagerForAgricultureResourcesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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..6df0a09119ee --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureResources ListByResourceGroup. + */ +public final class DataManagerForAgricultureResourcesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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..fe5fb06c12e8 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for DataManagerForAgricultureResources List. + */ +public final class DataManagerForAgricultureResourcesListSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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..d7f6cf532be3 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/DataManagerForAgricultureResourcesUpdateSamples.java @@ -0,0 +1,43 @@ +// 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/2023-06-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 new file mode 100644 index 000000000000..3db9c6feb568 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateOrUpdateSamples.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 Extensions CreateOrUpdate. + */ +public final class ExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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(); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateSamples.java deleted file mode 100644 index cd768456023c..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsCreateSamples.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.Context; - -/** Samples for Extensions Create. */ -public final class ExtensionsCreateSamples { - /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Create.json - */ - /** - * Sample code: Extensions_Create. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void extensionsCreate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .extensions() - .createWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", Context.NONE); - } -} 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 885668b071bf..e3e2696c1e6e 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.agrifood.generated; -import com.azure.core.util.Context; - -/** Samples for Extensions Delete. */ +/** + * Samples for Extensions Delete. + */ public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Delete.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Extensions_Delete.json */ /** * Sample code: Extensions_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", Context.NONE); + manager.extensions() + .deleteWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", + com.azure.core.util.Context.NONE); } } 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 164bcc7ef833..37adbeddf08f 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.agrifood.generated; -import com.azure.core.util.Context; - -/** Samples for Extensions Get. */ +/** + * Samples for Extensions Get. + */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Get.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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", Context.NONE); + manager.extensions() + .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", + com.azure.core.util.Context.NONE); } } 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..126bf44024a4 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByDataManagerForAgricultureSamples.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 Extensions ListByDataManagerForAgriculture. + */ +public final class ExtensionsListByDataManagerForAgricultureSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-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 011cf6c3e79b..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsSamples.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.Context; - -/** 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, Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsUpdateSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsUpdateSamples.java deleted file mode 100644 index 2167bec5b4e6..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/ExtensionsUpdateSamples.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.Context; - -/** Samples for Extensions Update. */ -public final class ExtensionsUpdateSamples { - /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Extensions_Update.json - */ - /** - * Sample code: Extensions_Update. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void extensionsUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .extensions() - .updateWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.extension", 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 6ea38a939b43..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsGetSamples.java +++ /dev/null @@ -1,22 +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.Context; - -/** 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", 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 f21b4be0ddd4..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsListSamples.java +++ /dev/null @@ -1,22 +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.Context; - -/** 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, 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/FarmBeatsModelsDeleteSamples.java deleted file mode 100644 index 6f739980ad40..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsDeleteSamples.java +++ /dev/null @@ -1,22 +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.Context; - -/** Samples for FarmBeatsModels Delete. */ -public final class FarmBeatsModelsDeleteSamples { - /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Delete.json - */ - /** - * Sample code: FarmBeatsModels_Delete. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsModelsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.farmBeatsModels().deleteWithResponse("examples-rg", "examples-farmBeatsResourceName", 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/FarmBeatsModelsGetByResourceGroupSamples.java deleted file mode 100644 index 04513bd717fb..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsGetByResourceGroupSamples.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.Context; - -/** Samples for FarmBeatsModels GetByResourceGroup. */ -public final class FarmBeatsModelsGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_Get.json - */ - /** - * Sample code: FarmBeatsModels_Get. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsModelsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .farmBeatsModels() - .getByResourceGroupWithResponse("examples-rg", "examples-farmBeatsResourceName", Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsGetOperationResultSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsGetOperationResultSamples.java deleted file mode 100644 index 2e16dcd3d7ee..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsGetOperationResultSamples.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.Context; - -/** Samples for FarmBeatsModels GetOperationResult. */ -public final class FarmBeatsModelsGetOperationResultSamples { - /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/FarmBeatsModels_GetOperationResult.json - */ - /** - * Sample code: FarmBeatsModels_GetOperationResult. - * - * @param manager Entry point to AgriFoodManager. - */ - public static void farmBeatsModelsGetOperationResult(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .farmBeatsModels() - .getOperationResultWithResponse( - "examples-rg", - "examples-farmBeatsResourceName", - "resource-provisioning-id-farmBeatsResourceName", - 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 cdde4675aace..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListByResourceGroupSamples.java +++ /dev/null @@ -1,22 +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.Context; - -/** 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, 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 bde4a9c942f9..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListSamples.java +++ /dev/null @@ -1,22 +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.Context; - -/** 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, 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 3dca6ed2b981..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsUpdateSamples.java +++ /dev/null @@ -1,68 +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.Context; -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", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).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", Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("key1", "value1", "key2", "value2")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties( - new FarmBeatsUpdateProperties().withSensorIntegration(new SensorIntegration().withEnabled("True"))) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/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/LocationsCheckNameAvailabilitySamples.java deleted file mode 100644 index fc0c7219c994..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/LocationsCheckNameAvailabilitySamples.java +++ /dev/null @@ -1,49 +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.Context; -import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityRequest; - -/** Samples for Locations CheckNameAvailability. */ -public final class LocationsCheckNameAvailabilitySamples { - /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_Available.json - */ - /** - * Sample code: Locations_CheckNameAvailability_Available. - * - * @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"), - Context.NONE); - } - - /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Locations_CheckNameAvailability_AlreadyExists.json - */ - /** - * Sample code: Locations_CheckNameAvailability_AlreadyExists. - * - * @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"), - Context.NONE); - } -} 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 new file mode 100644 index 000000000000..c6410152ca76 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/OperationResultsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for OperationResults Get. + */ +public final class OperationResultsGetSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/OperationResults_Get.json + */ + /** + * Sample code: OperationResults_Get. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void operationResultsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.operationResults() + .getWithResponse("westus", "resource-provisioning-id-farmBeatsResourceName", + com.azure.core.util.Context.NONE); + } +} 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 abf08de16c06..d31bc52bd0f9 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.agrifood.generated; -import com.azure.core.util.Context; - -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/Operations_List.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Operations_List.json */ /** * Sample code: Operations_List. - * + * * @param manager Entry point to AgriFoodManager. */ public static void operationsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } 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 1010e1f2a594..b06c1959a953 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 @@ -7,25 +7,25 @@ import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_CreateOrUpdate.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateEndpointConnections_CreateOrUpdate.json */ /** * Sample code: PrivateEndpointConnections_CreateOrUpdate. - * + * * @param manager Entry point to AgriFoodManager. */ - public static void privateEndpointConnectionsCreateOrUpdate( - com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateEndpointConnections() + public static void + privateEndpointConnectionsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.privateEndpointConnections() .define("privateEndpointConnectionName") .withExistingFarmBeat("examples-rg", "examples-farmbeatsResourceName") .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) .withDescription("Approved by johndoe@contoso.com")) .create(); } 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 d19602d5f0de..c79d03c9e4e9 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.agrifood.generated; -import com.azure.core.util.Context; - -/** Samples for PrivateEndpointConnections Delete. */ +/** + * Samples for PrivateEndpointConnections Delete. + */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Delete.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateEndpointConnections_Delete.json */ /** * Sample code: PrivateEndpointConnections_Delete. - * + * * @param manager Entry point to AgriFoodManager. */ public static void privateEndpointConnectionsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateEndpointConnections() - .delete("examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", Context.NONE); + manager.privateEndpointConnections() + .delete("examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", + com.azure.core.util.Context.NONE); } } 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 2f7491718b89..1df5ddb553e2 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 @@ -4,22 +4,21 @@ package com.azure.resourcemanager.agrifood.generated; -import com.azure.core.util.Context; - -/** Samples for PrivateEndpointConnections Get. */ +/** + * Samples for PrivateEndpointConnections Get. + */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_Get.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateEndpointConnections_Get.json */ /** * Sample code: PrivateEndpointConnections_Get. - * + * * @param manager Entry point to AgriFoodManager. */ public static void privateEndpointConnectionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateEndpointConnections() - .getWithResponse( - "examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", Context.NONE); + manager.privateEndpointConnections() + .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "privateEndpointConnectionName", + com.azure.core.util.Context.NONE); } } 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 4ab14fcaef33..9084d67d9db0 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.agrifood.generated; -import com.azure.core.util.Context; - -/** Samples for PrivateEndpointConnections ListByResource. */ +/** + * Samples for PrivateEndpointConnections ListByResource. + */ public final class PrivateEndpointConnectionsListByResourceSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateEndpointConnections_ListByResource.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateEndpointConnections_ListByResource.json */ /** * Sample code: PrivateEndpointConnections_ListByResource. - * + * * @param manager Entry point to AgriFoodManager. */ - public static void privateEndpointConnectionsListByResource( - com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateEndpointConnections() - .listByResource("examples-rg", "examples-farmbeatsResourceName", Context.NONE); + public static void + privateEndpointConnectionsListByResource(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.privateEndpointConnections() + .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 ce716628d4e2..9491d9b87ad6 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.agrifood.generated; -import com.azure.core.util.Context; - -/** Samples for PrivateLinkResources Get. */ +/** + * Samples for PrivateLinkResources Get. + */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_Get.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateLinkResources_Get.json */ /** * Sample code: PrivateLinkResources_Get. - * + * * @param manager Entry point to AgriFoodManager. */ public static void privateLinkResourcesGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager - .privateLinkResources() - .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "farmbeats", Context.NONE); + manager.privateLinkResources() + .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "farmbeats", + com.azure.core.util.Context.NONE); } } 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 84d24995d172..f4326f517e5e 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 @@ -4,19 +4,21 @@ package com.azure.resourcemanager.agrifood.generated; -import com.azure.core.util.Context; - -/** Samples for PrivateLinkResources ListByResource. */ +/** + * Samples for PrivateLinkResources ListByResource. + */ public final class PrivateLinkResourcesListByResourceSamples { /* - * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2021-09-01-preview/examples/PrivateLinkResources_ListByResource.json + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/PrivateLinkResources_ListByResource.json */ /** * Sample code: PrivateLinkResources_ListByResource. - * + * * @param manager Entry point to AgriFoodManager. */ public static void privateLinkResourcesListByResource(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { - manager.privateLinkResources().listByResource("examples-rg", "examples-farmbeatsResourceName", Context.NONE); + manager.privateLinkResources() + .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 new file mode 100644 index 000000000000..832fe1cf10ff --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsCreateOrUpdateSamples.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 Solutions CreateOrUpdate. + */ +public final class SolutionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Solutions_CreateOrUpdate.json + */ + /** + * Sample code: Solutions_CreateOrUpdate. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsCreateOrUpdate(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutions() + .define("abc.partner") + .withExistingFarmBeat("examples-rg", "examples-farmbeatsResourceName") + .create(); + } +} 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 new file mode 100644 index 000000000000..e388e78e4287 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for Solutions Delete. + */ +public final class SolutionsDeleteSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Solutions_Delete.json + */ + /** + * Sample code: Solutions_Delete. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsDelete(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutions() + .deleteWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.solution", + com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 000000000000..7f0dad58e618 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for SolutionsDiscoverability Get. + */ +public final class SolutionsDiscoverabilityGetSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/SolutionsDiscoverability_Get.json + */ + /** + * Sample code: SolutionsDiscoverability_Get. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsDiscoverabilityGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutionsDiscoverabilities().getWithResponse("bayerAgPowered.gdu", com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 000000000000..a8e5993c0fa1 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsDiscoverabilityListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for SolutionsDiscoverability List. + */ +public final class SolutionsDiscoverabilityListSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/SolutionsDiscoverability_List.json + */ + /** + * Sample code: SolutionsDiscoverability_List. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsDiscoverabilityList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutionsDiscoverabilities().list(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/SolutionsGetSamples.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetSamples.java new file mode 100644 index 000000000000..8672cc51f95e --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for Solutions Get. + */ +public final class SolutionsGetSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Solutions_Get.json + */ + /** + * Sample code: Solutions_Get. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsGet(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutions() + .getWithResponse("examples-rg", "examples-farmbeatsResourceName", "provider.solution", + com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 000000000000..af532d8224a0 --- /dev/null +++ b/sdk/agrifood/azure-resourcemanager-agrifood/src/samples/java/com/azure/resourcemanager/agrifood/generated/SolutionsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.agrifood.generated; + +/** + * Samples for Solutions List. + */ +public final class SolutionsListSamples { + /* + * x-ms-original-file: specification/agrifood/resource-manager/Microsoft.AgFoodPlatform/preview/2023-06-01-preview/examples/Solutions_List.json + */ + /** + * Sample code: Solutions_List. + * + * @param manager Entry point to AgriFoodManager. + */ + public static void solutionsList(com.azure.resourcemanager.agrifood.AgriFoodManager manager) { + manager.solutions() + .list("examples-rg", "examples-farmbeatsResourceName", null, null, null, null, null, null, null, null, null, + null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ArmAsyncOperationInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ArmAsyncOperationInnerTests.java deleted file mode 100644 index 9967610d75f4..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ArmAsyncOperationInnerTests.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; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.ArmAsyncOperationInner; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ArmAsyncOperationInnerTests { - @Test - public void testDeserialize() { - ArmAsyncOperationInner model = - BinaryData.fromString("{\"status\":\"hb\"}").toObject(ArmAsyncOperationInner.class); - Assertions.assertEquals("hb", model.status()); - } - - @Test - public void testSerialize() { - ArmAsyncOperationInner model = new ArmAsyncOperationInner().withStatus("hb"); - model = BinaryData.fromObject(model).toObject(ArmAsyncOperationInner.class); - Assertions.assertEquals("hb", model.status()); - } -} 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 f7fd54a3a7b1..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityRequestTests.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.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CheckNameAvailabilityRequestTests { - @Test - public void testDeserialize() { - CheckNameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"hejjz\",\"type\":\"dudgwdslfhot\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("hejjz", model.name()); - Assertions.assertEquals("dudgwdslfhot", model.type()); - } - - @Test - public void testSerialize() { - CheckNameAvailabilityRequest model = - new CheckNameAvailabilityRequest().withName("hejjz").withType("dudgwdslfhot"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("hejjz", model.name()); - Assertions.assertEquals("dudgwdslfhot", 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 9759852d5350..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/CheckNameAvailabilityResponseInnerTests.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.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.agrifood.models.CheckNameAvailabilityReason; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CheckNameAvailabilityResponseInnerTests { - @Test - public void testDeserialize() { - CheckNameAvailabilityResponseInner model = - BinaryData - .fromString("{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"wlbjnpgacftade\"}") - .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("wlbjnpgacftade", model.message()); - } - - @Test - public void testSerialize() { - CheckNameAvailabilityResponseInner model = - new CheckNameAvailabilityResponseInner() - .withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("wlbjnpgacftade"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("wlbjnpgacftade", model.message()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/DetailedInformationTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/DetailedInformationTests.java deleted file mode 100644 index ce79ba7da4bb..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/DetailedInformationTests.java +++ /dev/null @@ -1,50 +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.DetailedInformation; -import com.azure.resourcemanager.agrifood.models.UnitSystemsInfo; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DetailedInformationTests { - @Test - public void testDeserialize() { - DetailedInformation model = - BinaryData - .fromString( - "{\"apiName\":\"mgxsab\",\"customParameters\":[\"duuji\",\"c\",\"czdzev\",\"dhkrwpdappdsbdk\"],\"platformParameters\":[\"wjfeusnhutjel\",\"mrldhu\"],\"unitsSupported\":{\"key\":\"zzd\",\"values\":[\"qxhocdgeablgphut\",\"cndvkaozwyiftyhx\",\"urokft\"]},\"apiInputParameters\":[\"lniwpwcukjfkgiaw\",\"klryplwck\",\"asy\"]}") - .toObject(DetailedInformation.class); - Assertions.assertEquals("mgxsab", model.apiName()); - Assertions.assertEquals("duuji", model.customParameters().get(0)); - Assertions.assertEquals("wjfeusnhutjel", model.platformParameters().get(0)); - Assertions.assertEquals("zzd", model.unitsSupported().key()); - Assertions.assertEquals("qxhocdgeablgphut", model.unitsSupported().values().get(0)); - Assertions.assertEquals("lniwpwcukjfkgiaw", model.apiInputParameters().get(0)); - } - - @Test - public void testSerialize() { - DetailedInformation model = - new DetailedInformation() - .withApiName("mgxsab") - .withCustomParameters(Arrays.asList("duuji", "c", "czdzev", "dhkrwpdappdsbdk")) - .withPlatformParameters(Arrays.asList("wjfeusnhutjel", "mrldhu")) - .withUnitsSupported( - new UnitSystemsInfo() - .withKey("zzd") - .withValues(Arrays.asList("qxhocdgeablgphut", "cndvkaozwyiftyhx", "urokft"))) - .withApiInputParameters(Arrays.asList("lniwpwcukjfkgiaw", "klryplwck", "asy")); - model = BinaryData.fromObject(model).toObject(DetailedInformation.class); - Assertions.assertEquals("mgxsab", model.apiName()); - Assertions.assertEquals("duuji", model.customParameters().get(0)); - Assertions.assertEquals("wjfeusnhutjel", model.platformParameters().get(0)); - Assertions.assertEquals("zzd", model.unitsSupported().key()); - Assertions.assertEquals("qxhocdgeablgphut", model.unitsSupported().values().get(0)); - Assertions.assertEquals("lniwpwcukjfkgiaw", model.apiInputParameters().get(0)); - } -} 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 3e67efb87366..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionInnerTests.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; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.ExtensionInner; -import org.junit.jupiter.api.Test; - -public final class ExtensionInnerTests { - @Test - public void testDeserialize() { - ExtensionInner model = - BinaryData - .fromString( - "{\"properties\":{\"extensionId\":\"hq\",\"extensionCategory\":\"gjxpybczmehmt\",\"installedExtensionVersion\":\"pbsphrupidgs\",\"extensionAuthLink\":\"bejhphoycmsxa\",\"extensionApiDocsLink\":\"hdxbmtqio\"},\"eTag\":\"zehtbmu\",\"id\":\"p\",\"name\":\"wnoi\",\"type\":\"hwlrx\"}") - .toObject(ExtensionInner.class); - } - - @Test - public void testSerialize() { - 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/ExtensionListResponseTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionListResponseTests.java deleted file mode 100644 index b6342f9f81b9..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionListResponseTests.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.fluent.models.ExtensionInner; -import com.azure.resourcemanager.agrifood.models.ExtensionListResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class ExtensionListResponseTests { - @Test - public void testDeserialize() { - ExtensionListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"extensionId\":\"ifsqesaagdfmg\",\"extensionCategory\":\"lhjxr\",\"installedExtensionVersion\":\"kwm\",\"extensionAuthLink\":\"ktsizntocipaou\",\"extensionApiDocsLink\":\"psqucmpoyf\"},\"eTag\":\"fogknygjofjdde\",\"id\":\"s\",\"name\":\"deupewnwrei\",\"type\":\"jzyflu\"},{\"properties\":{\"extensionId\":\"hmofc\",\"extensionCategory\":\"smy\",\"installedExtensionVersion\":\"kdtmlxhekuk\",\"extensionAuthLink\":\"txukcdmp\",\"extensionApiDocsLink\":\"cryuan\"},\"eTag\":\"uxzdxtay\",\"id\":\"lhmwhfpmrqobm\",\"name\":\"u\",\"type\":\"knryrtihfxtij\"}],\"nextLink\":\"zvgnwzs\"}") - .toObject(ExtensionListResponse.class); - } - - @Test - public void testSerialize() { - ExtensionListResponse model = - new ExtensionListResponse().withValue(Arrays.asList(new ExtensionInner(), 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 6a30aeda1a9a..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionPropertiesTests.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; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.ExtensionProperties; -import org.junit.jupiter.api.Test; - -public final class ExtensionPropertiesTests { - @Test - public void testDeserialize() { - ExtensionProperties model = - BinaryData - .fromString( - "{\"extensionId\":\"qsoqijgkd\",\"extensionCategory\":\"pazlobcufpdz\",\"installedExtensionVersion\":\"btcqq\",\"extensionAuthLink\":\"qglhq\",\"extensionApiDocsLink\":\"ufo\"}") - .toObject(ExtensionProperties.class); - } - - @Test - public void testSerialize() { - 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/ExtensionsListByFarmBeatsTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsTests.java deleted file mode 100644 index 8ac60c953ff5..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/ExtensionsListByFarmBeatsTests.java +++ /dev/null @@ -1,76 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.Extension; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExtensionsListByFarmBeatsTests { - @Test - public void testListByFarmBeats() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"extensionId\":\"uzycispnqza\",\"extensionCategory\":\"gkbrpyyd\",\"installedExtensionVersion\":\"bnuqqkpik\",\"extensionAuthLink\":\"rgvtqag\",\"extensionApiDocsLink\":\"uynhijg\"},\"eTag\":\"ebf\",\"id\":\"iarbutrcvpna\",\"name\":\"zmhjrunmp\",\"type\":\"ttdbhrbnl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "jky", - "xjvuujqgidokg", - Arrays.asList("jyoxgvclt", "gsncghkjeszz", "bijhtxfvgxbf"), - Arrays.asList("xnehmpvec", "godebfqkkrbmpu"), - 525812320, - "riwflzlfb", - Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionInnerTests.java deleted file mode 100644 index 52c8d42c7364..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionInnerTests.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; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionInner; -import org.junit.jupiter.api.Test; - -public final class FarmBeatsExtensionInnerTests { - @Test - public void testDeserialize() { - FarmBeatsExtensionInner model = - BinaryData - .fromString( - "{\"properties\":{\"targetResourceType\":\"wfndiodjpsl\",\"farmBeatsExtensionId\":\"jdpvwryo\",\"farmBeatsExtensionName\":\"soacctazakl\",\"farmBeatsExtensionVersion\":\"ahbc\",\"publisherId\":\"ffdfdosygexpa\",\"description\":\"akhmsbzjhcrz\",\"extensionCategory\":\"dphlxaolt\",\"extensionAuthLink\":\"trg\",\"extensionApiDocsLink\":\"bpf\",\"detailedInformation\":[{\"apiName\":\"n\",\"customParameters\":[],\"platformParameters\":[],\"apiInputParameters\":[]}]},\"id\":\"rwzoxxjtfelluwf\",\"name\":\"it\",\"type\":\"np\"}") - .toObject(FarmBeatsExtensionInner.class); - } - - @Test - public void testSerialize() { - FarmBeatsExtensionInner model = new FarmBeatsExtensionInner(); - model = BinaryData.fromObject(model).toObject(FarmBeatsExtensionInner.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionListResponseTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionListResponseTests.java deleted file mode 100644 index 6856230039ac..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionListResponseTests.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.fluent.models.FarmBeatsExtensionInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsExtensionListResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class FarmBeatsExtensionListResponseTests { - @Test - public void testDeserialize() { - FarmBeatsExtensionListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"targetResourceType\":\"uf\",\"farmBeatsExtensionId\":\"zk\",\"farmBeatsExtensionName\":\"dbihanufhfcbj\",\"farmBeatsExtensionVersion\":\"a\",\"publisherId\":\"th\",\"description\":\"hab\",\"extensionCategory\":\"pikxwczbyscnpqxu\",\"extensionAuthLink\":\"vyq\",\"extensionApiDocsLink\":\"wby\",\"detailedInformation\":[]},\"id\":\"xvd\",\"name\":\"mjgr\",\"type\":\"fwvuk\"},{\"properties\":{\"targetResourceType\":\"udccsnhsjc\",\"farmBeatsExtensionId\":\"ejhkry\",\"farmBeatsExtensionName\":\"napczwlokjy\",\"farmBeatsExtensionVersion\":\"kkvnipjox\",\"publisherId\":\"nchgej\",\"description\":\"odmailzyd\",\"extensionCategory\":\"o\",\"extensionAuthLink\":\"yahux\",\"extensionApiDocsLink\":\"pmqnja\",\"detailedInformation\":[]},\"id\":\"xj\",\"name\":\"prozvcputegjvwmf\",\"type\":\"atscmd\"}],\"nextLink\":\"jhulsuuvmkjo\"}") - .toObject(FarmBeatsExtensionListResponse.class); - } - - @Test - public void testSerialize() { - FarmBeatsExtensionListResponse model = - new FarmBeatsExtensionListResponse() - .withValue(Arrays.asList(new FarmBeatsExtensionInner(), new FarmBeatsExtensionInner())); - model = BinaryData.fromObject(model).toObject(FarmBeatsExtensionListResponse.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionPropertiesTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionPropertiesTests.java deleted file mode 100644 index 36f63f60b342..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionPropertiesTests.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; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsExtensionProperties; -import org.junit.jupiter.api.Test; - -public final class FarmBeatsExtensionPropertiesTests { - @Test - public void testDeserialize() { - FarmBeatsExtensionProperties model = - BinaryData - .fromString( - "{\"targetResourceType\":\"fpjkjlxofp\",\"farmBeatsExtensionId\":\"hpf\",\"farmBeatsExtensionName\":\"ypininm\",\"farmBeatsExtensionVersion\":\"huyb\",\"publisherId\":\"podepoo\",\"description\":\"nuvamiheogna\",\"extensionCategory\":\"zxtheotusivyevcc\",\"extensionAuthLink\":\"ihnhun\",\"extensionApiDocsLink\":\"wjzrnfygxgisp\",\"detailedInformation\":[{\"apiName\":\"zfkufubljofx\",\"customParameters\":[\"fjaeq\",\"hqjbasvmsmj\",\"ulngsntn\"],\"platformParameters\":[\"kzgcwrwcl\",\"xwrljdouskcqvkoc\",\"cjdkwtnhxbnjbi\"],\"unitsSupported\":{\"key\":\"qrglssainqpjwn\",\"values\":[]},\"apiInputParameters\":[\"jfm\",\"pee\"]}]}") - .toObject(FarmBeatsExtensionProperties.class); - } - - @Test - public void testSerialize() { - FarmBeatsExtensionProperties model = new FarmBeatsExtensionProperties(); - model = BinaryData.fromObject(model).toObject(FarmBeatsExtensionProperties.class); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsListTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsListTests.java deleted file mode 100644 index cda5dc0fed15..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsExtensionsListTests.java +++ /dev/null @@ -1,75 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.FarmBeatsExtension; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FarmBeatsExtensionsListTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"targetResourceType\":\"iexzfeyue\",\"farmBeatsExtensionId\":\"ibx\",\"farmBeatsExtensionName\":\"wbhqwal\",\"farmBeatsExtensionVersion\":\"zyoxaepdkzjan\",\"publisherId\":\"xrhdwbavxbniwdjs\",\"description\":\"tsdbpgn\",\"extensionCategory\":\"txhp\",\"extensionAuthLink\":\"bzpfzab\",\"extensionApiDocsLink\":\"cuh\",\"detailedInformation\":[]},\"id\":\"tyq\",\"name\":\"klbb\",\"type\":\"vplwzbhv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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 - .farmBeatsExtensions() - .list( - Arrays.asList("kx", "yskpbhen", "tkcxywnytnrsy", "lqidyby"), - Arrays.asList("zfcl"), - Arrays.asList("axdbabph", "wrqlfktsthsuco", "mnyyazt", "bt"), - Arrays.asList("rq", "uedck"), - 1525019471, - Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsInnerTests.java deleted file mode 100644 index 83f8bb439a84..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsInnerTests.java +++ /dev/null @@ -1,60 +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.FarmBeatsInner; -import com.azure.resourcemanager.agrifood.models.Identity; -import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; -import com.azure.resourcemanager.agrifood.models.ResourceIdentityType; -import com.azure.resourcemanager.agrifood.models.SensorIntegration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FarmBeatsInnerTests { - @Test - public void testDeserialize() { - FarmBeatsInner model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"akeqs\",\"tenantId\":\"yb\",\"type\":\"SystemAssigned\"},\"properties\":{\"instanceUri\":\"qytbciq\",\"provisioningState\":\"Updating\",\"sensorIntegration\":{\"enabled\":\"mmnkzsmodmgl\",\"provisioningState\":\"Deleting\"},\"publicNetworkAccess\":\"Hybrid\",\"privateEndpointConnections\":{\"id\":\"utduqktapspwgcu\",\"name\":\"rtumkdosvq\",\"type\":\"hbmdgbbjfdd\"}},\"location\":\"mbmbexppbh\",\"tags\":{\"algbquxigjyjg\":\"rolfpfp\",\"lnerkujysvleju\":\"jaoyfhrtx\"},\"id\":\"fqawrlyxw\",\"name\":\"kcprbnw\",\"type\":\"xgjvtbv\"}") - .toObject(FarmBeatsInner.class); - Assertions.assertEquals("mbmbexppbh", model.location()); - Assertions.assertEquals("rolfpfp", model.tags().get("algbquxigjyjg")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("mmnkzsmodmgl", model.sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.publicNetworkAccess()); - } - - @Test - public void testSerialize() { - FarmBeatsInner model = - new FarmBeatsInner() - .withLocation("mbmbexppbh") - .withTags(mapOf("algbquxigjyjg", "rolfpfp", "lnerkujysvleju", "jaoyfhrtx")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withSensorIntegration(new SensorIntegration().withEnabled("mmnkzsmodmgl")) - .withPublicNetworkAccess(PublicNetworkAccess.HYBRID); - model = BinaryData.fromObject(model).toObject(FarmBeatsInner.class); - Assertions.assertEquals("mbmbexppbh", model.location()); - Assertions.assertEquals("rolfpfp", model.tags().get("algbquxigjyjg")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("mmnkzsmodmgl", model.sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.publicNetworkAccess()); - } - - @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/FarmBeatsListResponseTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsListResponseTests.java deleted file mode 100644 index 0b04a43926a4..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsListResponseTests.java +++ /dev/null @@ -1,78 +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.FarmBeatsInner; -import com.azure.resourcemanager.agrifood.models.FarmBeatsListResponse; -import com.azure.resourcemanager.agrifood.models.Identity; -import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; -import com.azure.resourcemanager.agrifood.models.ResourceIdentityType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FarmBeatsListResponseTests { - @Test - public void testDeserialize() { - FarmBeatsListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"clwhijcoejctbz\",\"tenantId\":\"s\",\"type\":\"SystemAssigned\"},\"properties\":{\"instanceUri\":\"kbfkg\",\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Enabled\"},\"location\":\"ppofmxaxcfjpgdd\",\"tags\":{\"exhd\":\"jjxhvpmo\"},\"id\":\"xibqeojnx\",\"name\":\"bzv\",\"type\":\"dntwndeicbtw\"},{\"identity\":{\"principalId\":\"aoqvuh\",\"tenantId\":\"cffcyddglmj\",\"type\":\"SystemAssigned\"},\"properties\":{\"instanceUri\":\"wpyeicxmqciwqvh\",\"provisioningState\":\"Updating\",\"publicNetworkAccess\":\"Hybrid\"},\"location\":\"dtopbob\",\"tags\":{\"w\":\"hm\",\"a\":\"a\"},\"id\":\"hrzayvvtpgvdf\",\"name\":\"iotkftutqxl\",\"type\":\"gxlefgugnxkrxd\"},{\"identity\":{\"principalId\":\"dt\",\"tenantId\":\"zrvqdr\",\"type\":\"SystemAssigned\"},\"properties\":{\"instanceUri\":\"big\",\"provisioningState\":\"Failed\",\"publicNetworkAccess\":\"Enabled\"},\"location\":\"wska\",\"tags\":{\"rvynhzgpph\":\"tzlcuiywgqywgn\",\"m\":\"cgyncocpecf\",\"bmqj\":\"coofsxlzev\"},\"id\":\"abcypmivk\",\"name\":\"lzu\",\"type\":\"ccfwnfnbacfion\"},{\"identity\":{\"principalId\":\"x\",\"tenantId\":\"qgtz\",\"type\":\"SystemAssigned\"},\"properties\":{\"instanceUri\":\"bqqwxrj\",\"provisioningState\":\"Deleting\",\"publicNetworkAccess\":\"Hybrid\"},\"location\":\"sub\",\"tags\":{\"ochcbonqvpkvl\":\"jampmngnzscxaqw\",\"ase\":\"xnj\"},\"id\":\"pheoflokeyy\",\"name\":\"enjbdlwtgrhp\",\"type\":\"jp\"}],\"nextLink\":\"masxazjpqyegu\"}") - .toObject(FarmBeatsListResponse.class); - Assertions.assertEquals("ppofmxaxcfjpgdd", model.value().get(0).location()); - Assertions.assertEquals("jjxhvpmo", model.value().get(0).tags().get("exhd")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - } - - @Test - public void testSerialize() { - FarmBeatsListResponse model = - new FarmBeatsListResponse() - .withValue( - Arrays - .asList( - new FarmBeatsInner() - .withLocation("ppofmxaxcfjpgdd") - .withTags(mapOf("exhd", "jjxhvpmo")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED), - new FarmBeatsInner() - .withLocation("dtopbob") - .withTags(mapOf("w", "hm", "a", "a")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPublicNetworkAccess(PublicNetworkAccess.HYBRID), - new FarmBeatsInner() - .withLocation("wska") - .withTags( - mapOf("rvynhzgpph", "tzlcuiywgqywgn", "m", "cgyncocpecf", "bmqj", "coofsxlzev")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED), - new FarmBeatsInner() - .withLocation("sub") - .withTags(mapOf("ochcbonqvpkvl", "jampmngnzscxaqw", "ase", "xnj")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withPublicNetworkAccess(PublicNetworkAccess.HYBRID))); - model = BinaryData.fromObject(model).toObject(FarmBeatsListResponse.class); - Assertions.assertEquals("ppofmxaxcfjpgdd", model.value().get(0).location()); - Assertions.assertEquals("jjxhvpmo", model.value().get(0).tags().get("exhd")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - } - - @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/FarmBeatsModelsListByResourceGroupTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListByResourceGroupTests.java deleted file mode 100644 index c1efc056924e..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListByResourceGroupTests.java +++ /dev/null @@ -1,75 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.FarmBeats; -import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; -import com.azure.resourcemanager.agrifood.models.ResourceIdentityType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FarmBeatsModelsListByResourceGroupTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"principalId\":\"jfcn\",\"tenantId\":\"k\",\"type\":\"SystemAssigned\"},\"properties\":{\"instanceUri\":\"bttk\",\"provisioningState\":\"Creating\",\"sensorIntegration\":{\"enabled\":\"nv\",\"provisioningState\":\"Creating\"},\"publicNetworkAccess\":\"Hybrid\",\"privateEndpointConnections\":{\"id\":\"lfplp\",\"name\":\"oxuscrpabgyepsbj\",\"type\":\"azqugxywpmueefj\"}},\"location\":\"wfqkquj\",\"tags\":{\"xtccmg\":\"uyonobglaoc\",\"wfudwpzntxhdzhl\":\"udxytlmoyrx\",\"hckfrlhrx\":\"qj\",\"ca\":\"bkyvp\"},\"id\":\"uzbpzkafku\",\"name\":\"b\",\"type\":\"rnwb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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.farmBeatsModels().listByResourceGroup("rupqsxvnmicy", 560100496, "ceoveilovno", Context.NONE); - - Assertions.assertEquals("wfqkquj", response.iterator().next().location()); - Assertions.assertEquals("uyonobglaoc", response.iterator().next().tags().get("xtccmg")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("nv", response.iterator().next().sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, response.iterator().next().publicNetworkAccess()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListTests.java deleted file mode 100644 index 0de2ce7a41cb..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsModelsListTests.java +++ /dev/null @@ -1,74 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.FarmBeats; -import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; -import com.azure.resourcemanager.agrifood.models.ResourceIdentityType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FarmBeatsModelsListTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"principalId\":\"svmkfssxquk\",\"tenantId\":\"plgmgsxnk\",\"type\":\"SystemAssigned\"},\"properties\":{\"instanceUri\":\"slpvlop\",\"provisioningState\":\"Failed\",\"sensorIntegration\":{\"enabled\":\"hxpkd\",\"provisioningState\":\"Updating\"},\"publicNetworkAccess\":\"Hybrid\",\"privateEndpointConnections\":{\"id\":\"a\",\"name\":\"m\",\"type\":\"yqupedeojnabckh\"}},\"location\":\"mtxpsiebtfh\",\"tags\":{\"qmhjjdhtld\":\"sapskr\"},\"id\":\"kyzxuutk\",\"name\":\"cwscwsvlx\",\"type\":\"togt\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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.farmBeatsModels().list(1239569697, "u", Context.NONE); - - Assertions.assertEquals("mtxpsiebtfh", response.iterator().next().location()); - Assertions.assertEquals("sapskr", response.iterator().next().tags().get("qmhjjdhtld")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("hxpkd", response.iterator().next().sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, response.iterator().next().publicNetworkAccess()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsPropertiesInnerTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsPropertiesInnerTests.java deleted file mode 100644 index bd735b393032..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsPropertiesInnerTests.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.util.BinaryData; -import com.azure.resourcemanager.agrifood.fluent.models.FarmBeatsPropertiesInner; -import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; -import com.azure.resourcemanager.agrifood.models.SensorIntegration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FarmBeatsPropertiesInnerTests { - @Test - public void testDeserialize() { - FarmBeatsPropertiesInner model = - BinaryData - .fromString( - "{\"instanceUri\":\"nguitnwuizgazxu\",\"provisioningState\":\"Creating\",\"sensorIntegration\":{\"enabled\":\"kyfi\",\"provisioningState\":\"Updating\"},\"publicNetworkAccess\":\"Hybrid\",\"privateEndpointConnections\":{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"htymw\",\"name\":\"sdkf\",\"type\":\"hwxmnteiwa\"}}") - .toObject(FarmBeatsPropertiesInner.class); - Assertions.assertEquals("kyfi", model.sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.publicNetworkAccess()); - } - - @Test - public void testSerialize() { - FarmBeatsPropertiesInner model = - new FarmBeatsPropertiesInner() - .withSensorIntegration(new SensorIntegration().withEnabled("kyfi")) - .withPublicNetworkAccess(PublicNetworkAccess.HYBRID); - model = BinaryData.fromObject(model).toObject(FarmBeatsPropertiesInner.class); - Assertions.assertEquals("kyfi", model.sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.publicNetworkAccess()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsUpdatePropertiesTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsUpdatePropertiesTests.java deleted file mode 100644 index ac5b31a3b0c5..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsUpdatePropertiesTests.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.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateProperties; -import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; -import com.azure.resourcemanager.agrifood.models.SensorIntegration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FarmBeatsUpdatePropertiesTests { - @Test - public void testDeserialize() { - FarmBeatsUpdateProperties model = - BinaryData - .fromString( - "{\"sensorIntegration\":{\"enabled\":\"gmaajrm\",\"provisioningState\":\"Succeeded\"},\"publicNetworkAccess\":\"Hybrid\"}") - .toObject(FarmBeatsUpdateProperties.class); - Assertions.assertEquals("gmaajrm", model.sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.publicNetworkAccess()); - } - - @Test - public void testSerialize() { - FarmBeatsUpdateProperties model = - new FarmBeatsUpdateProperties() - .withSensorIntegration(new SensorIntegration().withEnabled("gmaajrm")) - .withPublicNetworkAccess(PublicNetworkAccess.HYBRID); - model = BinaryData.fromObject(model).toObject(FarmBeatsUpdateProperties.class); - Assertions.assertEquals("gmaajrm", model.sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.publicNetworkAccess()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsUpdateRequestModelTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsUpdateRequestModelTests.java deleted file mode 100644 index 5a9b758ffd5b..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/FarmBeatsUpdateRequestModelTests.java +++ /dev/null @@ -1,63 +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.FarmBeatsUpdateProperties; -import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateRequestModel; -import com.azure.resourcemanager.agrifood.models.Identity; -import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess; -import com.azure.resourcemanager.agrifood.models.ResourceIdentityType; -import com.azure.resourcemanager.agrifood.models.SensorIntegration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FarmBeatsUpdateRequestModelTests { - @Test - public void testDeserialize() { - FarmBeatsUpdateRequestModel model = - BinaryData - .fromString( - "{\"location\":\"ysh\",\"identity\":{\"principalId\":\"afbljjgpbtoqcjmk\",\"tenantId\":\"a\",\"type\":\"SystemAssigned\"},\"properties\":{\"sensorIntegration\":{\"enabled\":\"qajzyulpkudjkr\",\"provisioningState\":\"Creating\"},\"publicNetworkAccess\":\"Hybrid\"},\"tags\":{\"xzlocxscp\":\"pgzgq\",\"j\":\"ierhhbcsglummaj\",\"jionpimexgstxgc\":\"odxobnbdxkqpxok\"}}") - .toObject(FarmBeatsUpdateRequestModel.class); - Assertions.assertEquals("ysh", model.location()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("qajzyulpkudjkr", model.properties().sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.properties().publicNetworkAccess()); - Assertions.assertEquals("pgzgq", model.tags().get("xzlocxscp")); - } - - @Test - public void testSerialize() { - FarmBeatsUpdateRequestModel model = - new FarmBeatsUpdateRequestModel() - .withLocation("ysh") - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties( - new FarmBeatsUpdateProperties() - .withSensorIntegration(new SensorIntegration().withEnabled("qajzyulpkudjkr")) - .withPublicNetworkAccess(PublicNetworkAccess.HYBRID)) - .withTags(mapOf("xzlocxscp", "pgzgq", "j", "ierhhbcsglummaj", "jionpimexgstxgc", "odxobnbdxkqpxok")); - model = BinaryData.fromObject(model).toObject(FarmBeatsUpdateRequestModel.class); - Assertions.assertEquals("ysh", model.location()); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("qajzyulpkudjkr", model.properties().sensorIntegration().enabled()); - Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.properties().publicNetworkAccess()); - Assertions.assertEquals("pgzgq", model.tags().get("xzlocxscp")); - } - - @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/IdentityTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/IdentityTests.java deleted file mode 100644 index 716bc4dab21c..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/IdentityTests.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.Identity; -import com.azure.resourcemanager.agrifood.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class IdentityTests { - @Test - public void testDeserialize() { - Identity model = - BinaryData - .fromString("{\"principalId\":\"sszdnru\",\"tenantId\":\"guhmuouqfpr\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @Test - public void testSerialize() { - 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/OperationDisplayTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationDisplayTests.java deleted file mode 100644 index 0f5c29c23e29..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationDisplayTests.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; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.OperationDisplay; -import org.junit.jupiter.api.Test; - -public final class OperationDisplayTests { - @Test - public void testDeserialize() { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"b\",\"resource\":\"czvyifq\",\"operation\":\"kdvjsll\",\"description\":\"vvdfwatkpnpul\"}") - .toObject(OperationDisplay.class); - } - - @Test - public void testSerialize() { - 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 6dae95ad567d..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationInnerTests.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.fluent.models.OperationInner; -import com.azure.resourcemanager.agrifood.models.OperationDisplay; -import org.junit.jupiter.api.Test; - -public final class OperationInnerTests { - @Test - public void testDeserialize() { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"xbezyiuokktwh\",\"isDataAction\":false,\"display\":{\"provider\":\"ywqsmbsurexim\",\"resource\":\"yocf\",\"operation\":\"ksymd\",\"description\":\"stkiiuxhqyud\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @Test - public void testSerialize() { - 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 f8d1b3e231ca..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationListResultTests.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; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.OperationListResult; -import org.junit.jupiter.api.Test; - -public final class OperationListResultTests { - @Test - public void testDeserialize() { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"tyfsoppusuesn\",\"isDataAction\":false,\"display\":{\"provider\":\"bavo\",\"resource\":\"zdmohctbqvu\",\"operation\":\"xdn\",\"description\":\"vo\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"gwdkcglhsl\",\"isDataAction\":true,\"display\":{\"provider\":\"ggd\",\"resource\":\"ixhbkuofqweykhm\",\"operation\":\"evfyexfwhybcib\",\"description\":\"vdcsitynn\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"tehfiqscjeypvh\",\"isDataAction\":true,\"display\":{\"provider\":\"q\",\"resource\":\"jrefovgmkqsle\",\"operation\":\"vxyqjpkcattpngjc\",\"description\":\"czsqpjhvm\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"sounqecanoaeu\",\"isDataAction\":false,\"display\":{\"provider\":\"ltrpmopj\",\"resource\":\"matuok\",\"operation\":\"fu\",\"description\":\"aodsfcpkv\"},\"origin\":\"user\",\"actionType\":\"Internal\"}],\"nextLink\":\"zmyzydagf\"}") - .toObject(OperationListResult.class); - } - - @Test - public void testSerialize() { - 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/OperationsListTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationsListTests.java deleted file mode 100644 index d08f1b52bd32..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/OperationsListTests.java +++ /dev/null @@ -1,65 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"hhseyv\",\"isDataAction\":true,\"display\":{\"provider\":\"slhs\",\"resource\":\"deemao\",\"operation\":\"xagkvtmelmqkrh\",\"description\":\"vljua\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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(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 efa7d8b2e32d..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionInnerTests { - @Test - public void testDeserialize() { - PrivateEndpointConnectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"zidnsezcxtbzsgfy\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ewmdw\",\"actionsRequired\":\"eiachboosflnr\"},\"provisioningState\":\"Creating\"},\"id\":\"pteehzzv\",\"name\":\"pyqr\",\"type\":\"mzinpvswjdk\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ewmdw", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("eiachboosflnr", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @Test - public void testSerialize() { - PrivateEndpointConnectionInner model = - new PrivateEndpointConnectionInner() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("ewmdw") - .withActionsRequired("eiachboosflnr")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ewmdw", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("eiachboosflnr", 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 9437c1217018..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,35 +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.PrivateEndpointConnectionListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionListResultTests { - @Test - public void testDeserialize() { - PrivateEndpointConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"ruwiqzbqjvsov\",\"name\":\"yokacspkw\",\"type\":\"hzdobpxjmflbvvnc\"},{\"properties\":{\"provisioningState\":\"Deleting\"},\"id\":\"wwzjuqkhrsajiwku\",\"name\":\"foskghsauuimj\",\"type\":\"vxieduugidyj\"},{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"osvexcsonpclhoc\",\"name\":\"hslkevleggzf\",\"type\":\"u\"}]}") - .toObject(PrivateEndpointConnectionListResult.class); - } - - @Test - public void testSerialize() { - PrivateEndpointConnectionListResult model = - new PrivateEndpointConnectionListResult() - .withValue( - Arrays - .asList( - new PrivateEndpointConnectionInner(), - new PrivateEndpointConnectionInner(), - new PrivateEndpointConnectionInner())); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - } -} 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 4f3c5c97898a..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionPropertiesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionPropertiesTests { - @Test - public void testDeserialize() { - PrivateEndpointConnectionProperties model = - BinaryData - .fromString( - "{\"privateEndpoint\":{\"id\":\"oodqxhcrm\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"t\",\"actionsRequired\":\"whdsoifiyip\"},\"provisioningState\":\"Creating\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("t", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("whdsoifiyip", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @Test - public void testSerialize() { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("t") - .withActionsRequired("whdsoifiyip")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("t", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("whdsoifiyip", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteTests.java deleted file mode 100644 index 323517e57702..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsDeleteTests.java +++ /dev/null @@ -1,62 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("c", "hmdua", "aex", Context.NONE); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceTests.java deleted file mode 100644 index d289a37dac47..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointConnectionsListByResourceTests.java +++ /dev/null @@ -1,79 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointConnection; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByResourceTests { - @Test - public void testListByResource() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"sgwbnbbeld\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"baliourqhakauha\",\"actionsRequired\":\"sfwxosowzxc\"},\"provisioningState\":\"Succeeded\"},\"id\":\"jooxdjebw\",\"name\":\"ucww\",\"type\":\"vo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("pvfadmwsrcr", "vxpvgomz", Context.NONE); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals( - "baliourqhakauha", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions - .assertEquals( - "sfwxosowzxc", 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 d48e9e14876b..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,22 +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; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointTests { - @Test - public void testDeserialize() { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"wpgrjbzno\"}").toObject(PrivateEndpoint.class); - } - - @Test - public void testSerialize() { - 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 3a059d5f3def..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,32 +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; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourceInnerTests { - @Test - public void testDeserialize() { - PrivateLinkResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"xzbinjeputt\",\"requiredMembers\":[\"wnuzoqftiyqzrnkc\",\"vyxlwhzlsicohoqq\"],\"requiredZoneNames\":[\"lryav\",\"hheunmmqhgyx\",\"konocu\",\"oklyaxuconuq\"]},\"id\":\"fkbey\",\"name\":\"ewrmjmwvvjektc\",\"type\":\"senhwlrs\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("lryav", model.requiredZoneNames().get(0)); - } - - @Test - public void testSerialize() { - PrivateLinkResourceInner model = - new PrivateLinkResourceInner() - .withRequiredZoneNames(Arrays.asList("lryav", "hheunmmqhgyx", "konocu", "oklyaxuconuq")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("lryav", 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 bcd3b9407551..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourceListResultTests.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.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.Test; - -public final class PrivateLinkResourceListResultTests { - @Test - public void testDeserialize() { - PrivateLinkResourceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"axkffei\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"vmezy\",\"name\":\"shxmzsbbzoggigrx\",\"type\":\"burvjxxjnspy\"},{\"properties\":{\"groupId\":\"koen\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"nvudwtiukb\",\"name\":\"dng\",\"type\":\"pocipazyxoegu\"},{\"properties\":{\"groupId\":\"npiucgygevqznty\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"p\",\"name\":\"zcdrqjsdpydnfyhx\",\"type\":\"eoejzic\"},{\"properties\":{\"groupId\":\"sjttgzfbish\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"ajdeyeamdphaga\",\"name\":\"pbuxwgipwhon\",\"type\":\"wkgshwa\"}]}") - .toObject(PrivateLinkResourceListResult.class); - } - - @Test - public void testSerialize() { - PrivateLinkResourceListResult model = - new PrivateLinkResourceListResult() - .withValue( - Arrays - .asList( - new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList()), - new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList()), - new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList()), - new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - } -} 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 8304fa8dc52f..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,32 +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; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourcePropertiesTests { - @Test - public void testDeserialize() { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"rzpwvlqdqgbiq\",\"requiredMembers\":[\"hkaetcktvfc\",\"vf\",\"nkymuctqhjfbebrj\"],\"requiredZoneNames\":[\"rfuwutt\",\"xfvjrbirp\",\"xepcyvahfn\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("rfuwutt", model.requiredZoneNames().get(0)); - } - - @Test - public void testSerialize() { - PrivateLinkResourceProperties model = - new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("rfuwutt", "xfvjrbirp", "xepcyvahfn")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("rfuwutt", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceTests.java deleted file mode 100644 index 82e1ed094afb..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkResourcesListByResourceTests.java +++ /dev/null @@ -1,69 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.agrifood.AgriFoodManager; -import com.azure.resourcemanager.agrifood.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByResourceTests { - @Test - public void testListByResource() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"groupId\":\"iotwmcdytdxwit\",\"requiredMembers\":[\"jawgqwg\"],\"requiredZoneNames\":[\"isk\"]},\"id\":\"bkpyc\",\"name\":\"klwndnhjdauwhv\",\"type\":\"l\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("bvmeuecivy", "zceuojgjrw", Context.NONE); - - Assertions.assertEquals("isk", 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 1f28843a5990..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/PrivateLinkServiceConnectionStateTests.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.util.BinaryData; -import com.azure.resourcemanager.agrifood.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.agrifood.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkServiceConnectionStateTests { - @Test - public void testDeserialize() { - PrivateLinkServiceConnectionState model = - BinaryData - .fromString("{\"status\":\"Pending\",\"description\":\"vsnb\",\"actionsRequired\":\"qabnmoc\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("vsnb", model.description()); - Assertions.assertEquals("qabnmoc", model.actionsRequired()); - } - - @Test - public void testSerialize() { - PrivateLinkServiceConnectionState model = - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("vsnb") - .withActionsRequired("qabnmoc"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("vsnb", model.description()); - Assertions.assertEquals("qabnmoc", model.actionsRequired()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SensorIntegrationTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SensorIntegrationTests.java deleted file mode 100644 index 5d0d7e36e8c4..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/SensorIntegrationTests.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.SensorIntegration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SensorIntegrationTests { - @Test - public void testDeserialize() { - SensorIntegration model = - BinaryData - .fromString("{\"enabled\":\"vkmijcmmxdcuf\",\"provisioningState\":\"Deleting\"}") - .toObject(SensorIntegration.class); - Assertions.assertEquals("vkmijcmmxdcuf", model.enabled()); - } - - @Test - public void testSerialize() { - SensorIntegration model = new SensorIntegration().withEnabled("vkmijcmmxdcuf"); - model = BinaryData.fromObject(model).toObject(SensorIntegration.class); - Assertions.assertEquals("vkmijcmmxdcuf", model.enabled()); - } -} diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/UnitSystemsInfoTests.java b/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/UnitSystemsInfoTests.java deleted file mode 100644 index 68c74c45a1b3..000000000000 --- a/sdk/agrifood/azure-resourcemanager-agrifood/src/test/java/com/azure/resourcemanager/agrifood/generated/UnitSystemsInfoTests.java +++ /dev/null @@ -1,32 +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.UnitSystemsInfo; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class UnitSystemsInfoTests { - @Test - public void testDeserialize() { - UnitSystemsInfo model = - BinaryData - .fromString("{\"key\":\"pnddhsgcbacphejk\",\"values\":[\"ynqgoulzndlikwyq\",\"gfgibm\"]}") - .toObject(UnitSystemsInfo.class); - Assertions.assertEquals("pnddhsgcbacphejk", model.key()); - Assertions.assertEquals("ynqgoulzndlikwyq", model.values().get(0)); - } - - @Test - public void testSerialize() { - UnitSystemsInfo model = - new UnitSystemsInfo().withKey("pnddhsgcbacphejk").withValues(Arrays.asList("ynqgoulzndlikwyq", "gfgibm")); - model = BinaryData.fromObject(model).toObject(UnitSystemsInfo.class); - Assertions.assertEquals("pnddhsgcbacphejk", model.key()); - Assertions.assertEquals("ynqgoulzndlikwyq", model.values().get(0)); - } -}