From fc1f06777f660e127e7fdccc34c40595457aedda Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 1 Oct 2022 18:32:16 +0000 Subject: [PATCH] CodeGen from PR 20502 in Azure/azure-rest-api-specs Merge a58f864ea566af5cfaaf857e68bd81ec89086322 into 0fc6ed4db447e7571208ad90a9f39287c5b992cc --- .../CHANGELOG.md | 3 +- .../README.md | 7 +- .../SAMPLE.md | 792 ++++++++++++++++++ .../pom.xml | 98 +-- .../hybridcompute/HybridComputeManager.java | 149 +++- .../fluent/ExtensionMetadatasClient.java | 79 ++ .../fluent/HybridComputeManagementClient.java | 14 + .../fluent/MachineExtensionsClient.java | 38 +- .../hybridcompute/fluent/MachinesClient.java | 32 +- .../fluent/OperationsClient.java | 4 +- .../PrivateEndpointConnectionsClient.java | 34 +- .../fluent/PrivateLinkResourcesClient.java | 17 +- .../fluent/PrivateLinkScopesClient.java | 74 +- .../fluent/ResourceProvidersClient.java | 81 ++ .../fluent/models/ExtensionValueInner.java | 86 ++ .../models/ExtensionValueProperties.java | 69 ++ .../HybridComputePrivateLinkScopeInner.java | 8 +- .../fluent/models/MachineExtensionInner.java | 261 +++++- .../models/MachineExtensionProperties.java | 73 +- .../MachineExtensionUpdateProperties.java | 72 +- .../fluent/models/MachineInner.java | 436 +++++++++- .../models/MachineProperties.java | 186 +++- .../models/MachineUpdateProperties.java | 77 +- .../fluent/models/OperationValueInner.java | 23 +- .../fluent/models/PatchSettings.java | 78 ++ .../PrivateEndpointConnectionInner.java | 12 +- .../models/PrivateLinkResourceInner.java | 12 +- ...rivateLinkScopeValidationDetailsInner.java | 12 +- .../ExtensionMetadatasClientImpl.java | 447 ++++++++++ .../ExtensionMetadatasImpl.java | 74 ++ .../implementation/ExtensionValueImpl.java | 57 ++ .../HybridComputeManagementClientBuilder.java | 62 +- .../HybridComputeManagementClientImpl.java | 43 +- .../HybridComputePrivateLinkScopeImpl.java | 4 + .../implementation/MachineExtensionImpl.java | 144 +++- .../MachineExtensionsClientImpl.java | 139 ++- .../implementation/MachineExtensionsImpl.java | 45 +- .../implementation/MachineImpl.java | 141 +++- .../implementation/MachinesClientImpl.java | 143 ++-- .../implementation/MachinesImpl.java | 28 +- .../implementation/OperationValueImpl.java | 4 + .../implementation/OperationsClientImpl.java | 17 +- .../implementation/OperationsImpl.java | 3 +- .../PrivateEndpointConnectionImpl.java | 4 + .../PrivateEndpointConnectionsClientImpl.java | 115 ++- .../PrivateEndpointConnectionsImpl.java | 49 +- .../PrivateLinkResourcesClientImpl.java | 66 +- .../PrivateLinkResourcesImpl.java | 21 +- .../PrivateLinkScopesClientImpl.java | 247 +++--- .../implementation/PrivateLinkScopesImpl.java | 53 +- .../ResourceProvidersClientImpl.java | 358 ++++++++ .../implementation/ResourceProvidersImpl.java | 47 ++ .../models/AgentConfiguration.java | 154 ++++ .../models/AgentConfigurationMode.java | 41 + .../models/AssessmentModeTypes.java | 38 + .../hybridcompute/models/CloudMetadata.java | 39 + .../models/ConfigurationExtension.java | 54 ++ .../models/ConnectionDetail.java | 8 +- .../models/ExtensionMetadatas.java | 72 ++ .../models/ExtensionTargetProperties.java | 50 ++ .../hybridcompute/models/ExtensionValue.java | 67 ++ .../models/ExtensionValueListResult.java | 44 + .../models/HybridComputePrivateLinkScope.java | 7 + ...bridComputePrivateLinkScopeListResult.java | 15 +- ...bridComputePrivateLinkScopeProperties.java | 38 +- .../hybridcompute/models/Identity.java | 8 +- .../models/InstanceViewTypes.java | 6 +- .../hybridcompute/models/LocationData.java | 11 +- .../hybridcompute/models/Machine.java | 197 ++++- .../models/MachineExtension.java | 301 ++++++- .../models/MachineExtensionInstanceView.java | 11 +- .../MachineExtensionInstanceViewStatus.java | 8 +- .../models/MachineExtensionUpdate.java | 222 ++++- .../models/MachineExtensionUpgrade.java | 63 ++ .../models/MachineExtensions.java | 18 +- .../models/MachineExtensionsListResult.java | 12 +- .../models/MachineListResult.java | 15 +- .../hybridcompute/models/MachineUpdate.java | 147 +++- .../hybridcompute/models/Machines.java | 32 +- .../hybridcompute/models/OSProfile.java | 70 +- .../models/OSProfileLinuxConfiguration.java | 89 ++ .../models/OSProfileWindowsConfiguration.java | 89 ++ .../models/OperationListResult.java | 8 +- .../hybridcompute/models/OperationValue.java | 7 + .../models/OperationValueDisplay.java | 8 +- .../hybridcompute/models/Operations.java | 4 +- .../hybridcompute/models/PatchModeTypes.java | 44 + .../models/PrivateEndpointConnection.java | 9 +- .../PrivateEndpointConnectionDataModel.java | 98 +++ .../PrivateEndpointConnectionListResult.java | 8 +- .../PrivateEndpointConnectionProperties.java | 24 +- .../models/PrivateEndpointConnections.java | 20 +- .../models/PrivateEndpointProperty.java | 8 +- .../models/PrivateLinkResource.java | 2 +- .../models/PrivateLinkResourceListResult.java | 8 +- .../models/PrivateLinkResourceProperties.java | 8 +- .../models/PrivateLinkResources.java | 17 +- .../models/PrivateLinkScopes.java | 46 +- .../models/PrivateLinkScopesResource.java | 10 +- ...ateLinkServiceConnectionStateProperty.java | 13 +- .../models/PublicNetworkAccessType.java | 11 +- .../models/ResourceIdentityType.java | 6 +- .../models/ResourceProviders.java | 40 + .../hybridcompute/models/ResourceUpdate.java | 10 +- .../hybridcompute/models/ServiceStatus.java | 76 ++ .../hybridcompute/models/ServiceStatuses.java | 84 ++ .../models/StatusLevelTypes.java | 8 +- .../hybridcompute/models/StatusTypes.java | 8 +- .../hybridcompute/models/TagsResource.java | 10 +- .../ExtensionMetadataGetSamples.java | 24 + .../ExtensionMetadataListSamples.java | 22 + ...achineExtensionsCreateOrUpdateSamples.java | 45 + .../MachineExtensionsDeleteSamples.java | 22 + .../MachineExtensionsGetSamples.java | 24 + .../MachineExtensionsListSamples.java | 22 + .../MachineExtensionsUpdateSamples.java | 50 ++ .../generated/MachinesDeleteSamples.java | 22 + .../MachinesGetByResourceGroupSamples.java | 22 + .../MachinesListByResourceGroupSamples.java | 23 + .../generated/MachinesListSamples.java | 23 + .../generated/OperationsListSamples.java | 23 + ...pointConnectionsCreateOrUpdateSamples.java | 34 + ...ivateEndpointConnectionsDeleteSamples.java | 25 + .../PrivateEndpointConnectionsGetSamples.java | 25 + ...nectionsListByPrivateLinkScopeSamples.java | 25 + .../PrivateLinkResourcesGetSamples.java | 25 + ...esourcesListByPrivateLinkScopeSamples.java | 23 + ...rivateLinkScopesCreateOrUpdateSamples.java | 57 ++ .../PrivateLinkScopesDeleteSamples.java | 22 + ...teLinkScopesGetByResourceGroupSamples.java | 24 + ...GetValidationDetailsForMachineSamples.java | 24 + ...LinkScopesGetValidationDetailsSamples.java | 24 + ...eLinkScopesListByResourceGroupSamples.java | 23 + .../PrivateLinkScopesListSamples.java | 22 + .../PrivateLinkScopesUpdateTagsSamples.java | 42 + ...ourceProviderUpgradeExtensionsSamples.java | 49 ++ 136 files changed, 7335 insertions(+), 1090 deletions(-) create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java rename sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/{ => fluent}/models/MachineExtensionProperties.java (75%) rename sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/{ => fluent}/models/MachineExtensionUpdateProperties.java (72%) rename sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/{ => fluent}/models/MachineProperties.java (69%) rename sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/{ => fluent}/models/MachineUpdateProperties.java (61%) create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java create mode 100644 sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md index af7e03153024f..f866f6a0ec958 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-10-01) +- Azure Resource Manager HybridCompute client library for Java. This package contains Microsoft Azure SDK for HybridCompute Management SDK. The Hybrid Compute Management Client. Package tag package-preview-2022-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-15) diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md index 734229fd84771..af857b12ec07d 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HybridCompute client library for Java. -This package contains Microsoft Azure SDK for HybridCompute Management SDK. The Hybrid Compute Management Client. Package tag package-preview-2021-03. 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 HybridCompute Management SDK. The Hybrid Compute Management Client. Package tag package-preview-2022-08. 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-hybridcompute - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md new file mode 100644 index 0000000000000..d1912aacdfd06 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md @@ -0,0 +1,792 @@ +# Code snippets and samples + + +## ExtensionMetadata + +- [Get](#extensionmetadata_get) +- [List](#extensionmetadata_list) + +## MachineExtensions + +- [CreateOrUpdate](#machineextensions_createorupdate) +- [Delete](#machineextensions_delete) +- [Get](#machineextensions_get) +- [List](#machineextensions_list) +- [Update](#machineextensions_update) + +## Machines + +- [Delete](#machines_delete) +- [GetByResourceGroup](#machines_getbyresourcegroup) +- [List](#machines_list) +- [ListByResourceGroup](#machines_listbyresourcegroup) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByPrivateLinkScope](#privateendpointconnections_listbyprivatelinkscope) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [ListByPrivateLinkScope](#privatelinkresources_listbyprivatelinkscope) + +## PrivateLinkScopes + +- [CreateOrUpdate](#privatelinkscopes_createorupdate) +- [Delete](#privatelinkscopes_delete) +- [GetByResourceGroup](#privatelinkscopes_getbyresourcegroup) +- [GetValidationDetails](#privatelinkscopes_getvalidationdetails) +- [GetValidationDetailsForMachine](#privatelinkscopes_getvalidationdetailsformachine) +- [List](#privatelinkscopes_list) +- [ListByResourceGroup](#privatelinkscopes_listbyresourcegroup) +- [UpdateTags](#privatelinkscopes_updatetags) + +## ResourceProvider + +- [UpgradeExtensions](#resourceprovider_upgradeextensions) +### ExtensionMetadata_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExtensionMetadata Get. */ +public final class ExtensionMetadataGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/ExtensionMetadata_Get.json + */ + /** + * Sample code: GET an extensions metadata. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAnExtensionsMetadata(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .getWithResponse("EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", "1.9.1", Context.NONE); + } +} +``` + +### ExtensionMetadata_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExtensionMetadata List. */ +public final class ExtensionMetadataListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/ExtensionMetadata_List.json + */ + /** + * Sample code: GET a list of extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAListOfExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.extensionMetadatas().list("EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", Context.NONE); + } +} +``` + +### MachineExtensions_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for MachineExtensions CreateOrUpdate. */ +public final class MachineExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PUTExtension.json + */ + /** + * Sample code: Create or Update a Machine Extension. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateAMachineExtension( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineExtensions() + .define("CustomScriptExtension") + .withRegion("eastus2euap") + .withExistingMachine("myResourceGroup", "myMachine") + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### MachineExtensions_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for MachineExtensions Delete. */ +public final class MachineExtensionsDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/DELETEExtension.json + */ + /** + * Sample code: Delete a Machine Extension. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteAMachineExtension(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machineExtensions().delete("myResourceGroup", "myMachine", "MMA", Context.NONE); + } +} +``` + +### MachineExtensions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for MachineExtensions Get. */ +public final class MachineExtensionsGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/GETExtension.json + */ + /** + * Sample code: GET Machine Extension. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETMachineExtension(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineExtensions() + .getWithResponse("myResourceGroup", "myMachine", "CustomScriptExtension", Context.NONE); + } +} +``` + +### MachineExtensions_List + +```java +import com.azure.core.util.Context; + +/** Samples for MachineExtensions List. */ +public final class MachineExtensionsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/LISTExtension.json + */ + /** + * Sample code: GET all Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAllMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machineExtensions().list("myResourceGroup", "myMachine", null, Context.NONE); + } +} +``` + +### MachineExtensions_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.models.MachineExtension; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MachineExtensions Update. */ +public final class MachineExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/UpdateExtension.json + */ + /** + * Sample code: Create or Update a Machine Extension. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateAMachineExtension( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + MachineExtension resource = + manager + .machineExtensions() + .getWithResponse("myResourceGroup", "myMachine", "CustomScriptExtension", Context.NONE) + .getValue(); + resource + .update() + .withPublisher("Microsoft.Compute") + .withType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(true) + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"")) + .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; + } +} +``` + +### Machines_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Machines Delete. */ +public final class MachinesDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Machines_Delete.json + */ + /** + * Sample code: Delete a Machine. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteAMachine(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().deleteByResourceGroupWithResponse("myResourceGroup", "myMachine", Context.NONE); + } +} +``` + +### Machines_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Machines GetByResourceGroup. */ +public final class MachinesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Machines_Get.json + */ + /** + * Sample code: Get Machine. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getMachine(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().getByResourceGroupWithResponse("myResourceGroup", "myMachine", null, Context.NONE); + } +} +``` + +### Machines_List + +```java +import com.azure.core.util.Context; + +/** Samples for Machines List. */ +public final class MachinesListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Machines_ListBySubscription.json + */ + /** + * Sample code: List Machines by resource group. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listMachinesByResourceGroup( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().list(Context.NONE); + } +} +``` + +### Machines_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Machines ListByResourceGroup. */ +public final class MachinesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Machines_ListByResourceGroup.json + */ + /** + * Sample code: List Machines by resource group. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listMachinesByResourceGroup( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().listByResourceGroup("myResourceGroup", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Operations_List.json + */ + /** + * Sample code: List Hybrid Compute Provider Operations. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listHybridComputeProviderOperations( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateEndpointConnections() + .define("private-endpoint-connection-name") + .withExistingPrivateLinkScope("myResourceGroup", "myPrivateLinkScope") + .withProperties( + new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionStateProperty() + .withStatus("Approved") + .withDescription("Approved by johndoe@contoso.com"))) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateEndpointConnections() + .delete("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByPrivateLinkScope + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByPrivateLinkScope. */ +public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: Gets list of private endpoint connections on a private link scope. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateEndpointConnections() + .listByPrivateLinkScope("myResourceGroup", "myPrivateLinkScope", Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkResources() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "hybridcompute", Context.NONE); + } +} +``` + +### PrivateLinkResources_ListByPrivateLinkScope + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByPrivateLinkScope. */ +public final class PrivateLinkResourcesListByPrivateLinkScopeSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.privateLinkResources().listByPrivateLinkScope("myResourceGroup", "myPrivateLinkScope", Context.NONE); + } +} +``` + +### PrivateLinkScopes_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for PrivateLinkScopes CreateOrUpdate. */ +public final class PrivateLinkScopesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesCreate.json + */ + /** + * Sample code: PrivateLinkScopeCreate. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeCreate(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .create(); + } + + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesUpdate.json + */ + /** + * Sample code: PrivateLinkScopeUpdate. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeUpdate(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("Tag1", "Value1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### PrivateLinkScopes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes Delete. */ +public final class PrivateLinkScopesDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesDelete.json + */ + /** + * Sample code: PrivateLinkScopesDelete. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopesDelete(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.privateLinkScopes().delete("my-resource-group", "my-privatelinkscope", Context.NONE); + } +} +``` + +### PrivateLinkScopes_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetByResourceGroup. */ +public final class PrivateLinkScopesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesGet.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeGet(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", Context.NONE); + } +} +``` + +### PrivateLinkScopes_GetValidationDetails + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetValidationDetails. */ +public final class PrivateLinkScopesGetValidationDetailsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesGetValidation.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeGet(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .getValidationDetailsWithResponse("wus2", "f5dc51d3-92ed-4d7e-947a-775ea79b4919", Context.NONE); + } +} +``` + +### PrivateLinkScopes_GetValidationDetailsForMachine + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetValidationDetailsForMachine. */ +public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesGetValidationForMachine.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeGet(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .getValidationDetailsForMachineWithResponse("my-resource-group", "machineName", Context.NONE); + } +} +``` + +### PrivateLinkScopes_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes List. */ +public final class PrivateLinkScopesListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesList.json + */ + /** + * Sample code: PrivateLinkScopesList.json. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopesListJson(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.privateLinkScopes().list(Context.NONE); + } +} +``` + +### PrivateLinkScopes_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes ListByResourceGroup. */ +public final class PrivateLinkScopesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesListByResourceGroup.json + */ + /** + * Sample code: PrivateLinkScopeListByResourceGroup. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeListByResourceGroup( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.privateLinkScopes().listByResourceGroup("my-resource-group", Context.NONE); + } +} +``` + +### PrivateLinkScopes_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PrivateLinkScopes UpdateTags. */ +public final class PrivateLinkScopesUpdateTagsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + */ + /** + * Sample code: PrivateLinkScopeUpdateTagsOnly. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeUpdateTagsOnly( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + HybridComputePrivateLinkScope resource = + manager + .privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ResourceProvider_UpgradeExtensions + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.models.ExtensionTargetProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ResourceProvider UpgradeExtensions. */ +public final class ResourceProviderUpgradeExtensionsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Extensions_Upgrade.json + */ + /** + * Sample code: Upgrade Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void upgradeMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .resourceProviders() + .upgradeExtensions( + "myResourceGroup", + "myMachine", + new MachineExtensionUpgrade() + .withExtensionTargets( + mapOf( + "Microsoft.Azure.Monitoring", + new ExtensionTargetProperties().withTargetVersion("2.0"), + "Microsoft.Compute.CustomScriptExtension", + new ExtensionTargetProperties().withTargetVersion("1.10"))), + 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; + } +} +``` + diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml index df959e6225b10..63c62a9aa77f8 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-hybridcompute - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-hybridcompute + 1.0.0-beta.2 + jar - Microsoft Azure SDK for HybridCompute Management - This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2021-03. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for HybridCompute Management + This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2022-08. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.32.0 - - - com.azure - azure-core-management - 1.8.0 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.32.0 + + + com.azure + azure-core-management + 1.8.0 + + diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java index 1c1d7418fc4c5..b0c5e1b02ff06 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java @@ -8,19 +8,23 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.HybridComputeManagementClient; +import com.azure.resourcemanager.hybridcompute.implementation.ExtensionMetadatasImpl; import com.azure.resourcemanager.hybridcompute.implementation.HybridComputeManagementClientBuilder; import com.azure.resourcemanager.hybridcompute.implementation.MachineExtensionsImpl; import com.azure.resourcemanager.hybridcompute.implementation.MachinesImpl; @@ -28,17 +32,21 @@ import com.azure.resourcemanager.hybridcompute.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.hybridcompute.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.hybridcompute.implementation.PrivateLinkScopesImpl; +import com.azure.resourcemanager.hybridcompute.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.hybridcompute.models.ExtensionMetadatas; import com.azure.resourcemanager.hybridcompute.models.MachineExtensions; import com.azure.resourcemanager.hybridcompute.models.Machines; import com.azure.resourcemanager.hybridcompute.models.Operations; import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnections; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResources; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopes; +import com.azure.resourcemanager.hybridcompute.models.ResourceProviders; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to HybridComputeManager. The Hybrid Compute Management Client. */ public final class HybridComputeManager { @@ -46,6 +54,10 @@ public final class HybridComputeManager { private MachineExtensions machineExtensions; + private ResourceProviders resourceProviders; + + private ExtensionMetadatas extensionMetadatas; + private Operations operations; private PrivateLinkScopes privateLinkScopes; @@ -81,6 +93,19 @@ public static HybridComputeManager authenticate(TokenCredential credential, Azur return configure().authenticate(credential, profile); } + /** + * Creates an instance of HybridCompute service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the HybridCompute service API instance. + */ + public static HybridComputeManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new HybridComputeManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create HybridComputeManager with optional configuration. * @@ -92,12 +117,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -136,6 +163,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -147,6 +185,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

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. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -154,9 +205,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -192,20 +245,38 @@ public HybridComputeManager authenticate(TokenCredential credential, AzureProfil userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); 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())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -217,7 +288,11 @@ public HybridComputeManager authenticate(TokenCredential credential, AzureProfil } } - /** @return Resource collection API of Machines. */ + /** + * Gets the resource collection API of Machines. + * + * @return Resource collection API of Machines. + */ public Machines machines() { if (this.machines == null) { this.machines = new MachinesImpl(clientObject.getMachines(), this); @@ -225,7 +300,11 @@ public Machines machines() { return machines; } - /** @return Resource collection API of MachineExtensions. */ + /** + * Gets the resource collection API of MachineExtensions. It manages MachineExtension. + * + * @return Resource collection API of MachineExtensions. + */ public MachineExtensions machineExtensions() { if (this.machineExtensions == null) { this.machineExtensions = new MachineExtensionsImpl(clientObject.getMachineExtensions(), this); @@ -233,7 +312,35 @@ public MachineExtensions machineExtensions() { return machineExtensions; } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of ExtensionMetadatas. + * + * @return Resource collection API of ExtensionMetadatas. + */ + public ExtensionMetadatas extensionMetadatas() { + if (this.extensionMetadatas == null) { + this.extensionMetadatas = new ExtensionMetadatasImpl(clientObject.getExtensionMetadatas(), this); + } + return extensionMetadatas; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -241,7 +348,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of PrivateLinkScopes. */ + /** + * Gets the resource collection API of PrivateLinkScopes. It manages HybridComputePrivateLinkScope. + * + * @return Resource collection API of PrivateLinkScopes. + */ public PrivateLinkScopes privateLinkScopes() { if (this.privateLinkScopes == null) { this.privateLinkScopes = new PrivateLinkScopesImpl(clientObject.getPrivateLinkScopes(), this); @@ -249,7 +360,11 @@ public PrivateLinkScopes privateLinkScopes() { return privateLinkScopes; } - /** @return Resource collection API of PrivateLinkResources. */ + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ public PrivateLinkResources privateLinkResources() { if (this.privateLinkResources == null) { this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); @@ -257,7 +372,11 @@ public PrivateLinkResources privateLinkResources() { return privateLinkResources; } - /** @return Resource collection API of PrivateEndpointConnections. */ + /** + * 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 = diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java new file mode 100644 index 0000000000000..0c4503ecb66e0 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.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.hybridcompute.fluent.models.ExtensionValueInner; + +/** An instance of this class provides access to all the operations defined in ExtensionMetadatasClient. */ +public interface ExtensionMetadatasClient { + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context); + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionValueInner get(String location, String publisher, String extensionType, String version); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String publisher, String extensionType); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String publisher, String extensionType, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java index 9363ab1e34962..660f7849541ab 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java @@ -58,6 +58,20 @@ public interface HybridComputeManagementClient { */ MachineExtensionsClient getMachineExtensions(); + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the ExtensionMetadatasClient object to access its operations. + * + * @return the ExtensionMetadatasClient object. + */ + ExtensionMetadatasClient getExtensionMetadatas(); + /** * Gets the OperationsClient object to access its operations. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachineExtensionsClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachineExtensionsClient.java index c82677a25ea7d..14455916ca88e 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachineExtensionsClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachineExtensionsClient.java @@ -26,9 +26,9 @@ public interface MachineExtensionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link SyncPoller} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MachineExtensionInner> beginCreateOrUpdate( String resourceGroupName, String machineName, String extensionName, MachineExtensionInner extensionParameters); @@ -43,9 +43,9 @@ SyncPoller, MachineExtensionInner> beginCreate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link SyncPoller} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MachineExtensionInner> beginCreateOrUpdate( String resourceGroupName, String machineName, @@ -100,9 +100,9 @@ MachineExtensionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link SyncPoller} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MachineExtensionInner> beginUpdate( String resourceGroupName, String machineName, String extensionName, MachineExtensionUpdate extensionParameters); @@ -117,9 +117,9 @@ SyncPoller, MachineExtensionInner> beginUpdate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link SyncPoller} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MachineExtensionInner> beginUpdate( String resourceGroupName, String machineName, @@ -173,9 +173,9 @@ MachineExtensionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String machineName, String extensionName); /** @@ -188,9 +188,9 @@ MachineExtensionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String machineName, String extensionName, Context context); @@ -227,13 +227,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the machine containing the extension. * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - MachineExtensionInner get(String resourceGroupName, String machineName, String extensionName); + Response getWithResponse( + String resourceGroupName, String machineName, String extensionName, Context context); /** * The operation to get the extension. @@ -241,15 +243,13 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the machine containing the extension. * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String machineName, String extensionName, Context context); + MachineExtensionInner get(String resourceGroupName, String machineName, String extensionName); /** * The operation to get all extensions of a non-Azure machine. @@ -259,7 +259,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String machineName); @@ -274,7 +274,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java index a85dc990e858b..052a74eb4a8fc 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java @@ -15,59 +15,59 @@ /** An instance of this class provides access to all the operations defined in MachinesClient. */ public interface MachinesClient { /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 machineName); + Response deleteWithResponse(String resourceGroupName, String machineName, Context context); /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String machineName, Context context); + void delete(String resourceGroupName, String machineName); /** * Retrieves information about the model view or the instance view of a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a hybrid machine. + * @return describes a hybrid machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - MachineInner getByResourceGroup(String resourceGroupName, String machineName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String machineName, InstanceViewTypes expand, Context context); /** * Retrieves information about the model view or the instance view of a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a hybrid machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String machineName, InstanceViewTypes expand, Context context); + MachineInner getByResourceGroup(String resourceGroupName, String machineName); /** * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get @@ -77,7 +77,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -91,7 +91,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -102,7 +102,7 @@ Response getByResourceGroupWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -115,7 +115,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/OperationsClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/OperationsClient.java index 67bf2dff630e8..1e9ec54cd726c 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/OperationsClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.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 hybrid compute operations. + * @return a list of hybrid compute operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 hybrid compute operations. + * @return a list of hybrid compute operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateEndpointConnectionsClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateEndpointConnectionsClient.java index eadfc4bb2553e..2bf9cede48463 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateEndpointConnectionsClient.java @@ -21,14 +21,15 @@ public interface PrivateEndpointConnectionsClient { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String scopeName, String privateEndpointConnectionName); + Response getWithResponse( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); /** * Gets a private endpoint connection. @@ -36,15 +37,14 @@ PrivateEndpointConnectionInner get( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnectionInner get( + String resourceGroupName, String scopeName, String privateEndpointConnectionName); /** * Approve or reject a private endpoint connection with a given name. @@ -56,9 +56,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return the {@link SyncPoller} for polling of a private endpoint connection. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String scopeName, @@ -76,9 +76,9 @@ SyncPoller, PrivateEndpointConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return the {@link SyncPoller} for polling of a private endpoint connection. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String scopeName, @@ -135,9 +135,9 @@ PrivateEndpointConnectionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String scopeName, String privateEndpointConnectionName); @@ -151,9 +151,9 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); @@ -192,7 +192,8 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); @@ -206,7 +207,8 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPrivateLinkScope( diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateLinkResourcesClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateLinkResourcesClient.java index 12d50d505d4e6..e590c144e5db6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateLinkResourcesClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateLinkResourcesClient.java @@ -21,7 +21,8 @@ public interface PrivateLinkResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); @@ -35,7 +36,8 @@ public interface PrivateLinkResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPrivateLinkScope( @@ -47,13 +49,16 @@ PagedIterable listByPrivateLinkScope( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName); + Response getWithResponse( + String resourceGroupName, String scopeName, String groupName, Context context); /** * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. @@ -61,13 +66,11 @@ PagedIterable listByPrivateLinkScope( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String scopeName, String groupName, Context context); + PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateLinkScopesClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateLinkScopesClient.java index 2ee30ea56706b..f334ae205a651 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateLinkScopesClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/PrivateLinkScopesClient.java @@ -22,7 +22,8 @@ public interface PrivateLinkScopesClient { * * @throws com.azure.core.management.exception.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 all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -34,7 +35,8 @@ public interface PrivateLinkScopesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -46,7 +48,8 @@ public interface PrivateLinkScopesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -59,7 +62,8 @@ public interface PrivateLinkScopesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -72,9 +76,9 @@ public interface PrivateLinkScopesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName); /** @@ -86,9 +90,9 @@ public interface PrivateLinkScopesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, Context context); /** @@ -121,28 +125,28 @@ public interface PrivateLinkScopesClient { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope 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 an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - HybridComputePrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String scopeName, Context context); /** * Returns a Azure Arc PrivateLinkScope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope 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 an Azure Arc PrivateLinkScope definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String scopeName, Context context); + HybridComputePrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName); /** * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for @@ -152,14 +156,15 @@ Response getByResourceGroupWithResponse( * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters * PrivateLinkScope. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - HybridComputePrivateLinkScopeInner createOrUpdate( - String resourceGroupName, String scopeName, HybridComputePrivateLinkScopeInner parameters); + Response createOrUpdateWithResponse( + String resourceGroupName, String scopeName, HybridComputePrivateLinkScopeInner parameters, Context context); /** * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for @@ -169,15 +174,14 @@ HybridComputePrivateLinkScopeInner createOrUpdate( * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters * PrivateLinkScope. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Arc PrivateLinkScope definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String scopeName, HybridComputePrivateLinkScopeInner parameters, Context context); + HybridComputePrivateLinkScopeInner createOrUpdate( + String resourceGroupName, String scopeName, HybridComputePrivateLinkScopeInner parameters); /** * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. @@ -185,14 +189,15 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - HybridComputePrivateLinkScopeInner updateTags( - String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags); + Response updateTagsWithResponse( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags, Context context); /** * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. @@ -200,69 +205,68 @@ HybridComputePrivateLinkScopeInner updateTags( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Arc PrivateLinkScope definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateTagsWithResponse( - String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags, Context context); + HybridComputePrivateLinkScopeInner updateTags( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags); /** * Returns a Azure Arc PrivateLinkScope's validation details. * * @param location The location of the target resource. * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope 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 response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkScopeValidationDetailsInner getValidationDetails(String location, String privateLinkScopeId); + Response getValidationDetailsWithResponse( + String location, String privateLinkScopeId, Context context); /** * Returns a Azure Arc PrivateLinkScope's validation details. * * @param location The location of the target resource. * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope 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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getValidationDetailsWithResponse( - String location, String privateLinkScopeId, Context context); + PrivateLinkScopeValidationDetailsInner getValidationDetails(String location, String privateLinkScopeId); /** * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the target machine to get the private link scope validation details for. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkScopeValidationDetailsInner getValidationDetailsForMachine(String resourceGroupName, String machineName); + Response getValidationDetailsForMachineWithResponse( + String resourceGroupName, String machineName, Context context); /** * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the target machine to get the private link scope validation details for. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getValidationDetailsForMachineWithResponse( - String resourceGroupName, String machineName, Context context); + PrivateLinkScopeValidationDetailsInner getValidationDetailsForMachine(String resourceGroupName, String machineName); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..22c4e9a1c6958 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java new file mode 100644 index 0000000000000..2dbed12fa9426 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a Extension Metadata. */ +@Immutable +public final class ExtensionValueInner extends ProxyResource { + /* + * The single extension based on search criteria + */ + @JsonProperty(value = "properties") + private ExtensionValueProperties 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 ExtensionValueInner class. */ + public ExtensionValueInner() { + } + + /** + * Get the innerProperties property: The single extension based on search criteria. + * + * @return the innerProperties value. + */ + private ExtensionValueProperties 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 version property: The version of the Extension being received. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the extensionType property: The type of the Extension being received. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.innerProperties() == null ? null : this.innerProperties().extensionType(); + } + + /** + * Get the publisher property: The publisher of the Extension being received. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java new file mode 100644 index 0000000000000..e4d1cd9242230 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes Extension Metadata properties. */ +@Immutable +public final class ExtensionValueProperties { + /* + * The version of the Extension being received. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The type of the Extension being received. + */ + @JsonProperty(value = "extensionType", access = JsonProperty.Access.WRITE_ONLY) + private String extensionType; + + /* + * The publisher of the Extension being received. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /** Creates an instance of ExtensionValueProperties class. */ + public ExtensionValueProperties() { + } + + /** + * Get the version property: The version of the Extension being received. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the extensionType property: The type of the Extension being received. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.extensionType; + } + + /** + * Get the publisher property: The publisher of the Extension being received. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridComputePrivateLinkScopeInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridComputePrivateLinkScopeInner.java index db2422834719e..6655bb8604dd7 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridComputePrivateLinkScopeInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/HybridComputePrivateLinkScopeInner.java @@ -6,18 +6,14 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopesResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** An Azure Arc PrivateLinkScope definition. */ @Fluent public final class HybridComputePrivateLinkScopeInner extends PrivateLinkScopesResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridComputePrivateLinkScopeInner.class); - /* * Properties that define a Azure Arc PrivateLinkScope resource. */ @@ -30,6 +26,10 @@ public final class HybridComputePrivateLinkScopeInner extends PrivateLinkScopesR @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of HybridComputePrivateLinkScopeInner class. */ + public HybridComputePrivateLinkScopeInner() { + } + /** * Get the properties property: Properties that define a Azure Arc PrivateLinkScope resource. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java index c39f1b42b5a49..0dac2a8317fe7 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java @@ -7,51 +7,40 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Describes a Machine Extension. */ @Fluent public final class MachineExtensionInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineExtensionInner.class); - /* * Describes Machine Extension Properties. */ @JsonProperty(value = "properties") - private MachineExtensionProperties properties; + private MachineExtensionProperties innerProperties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** - * Get the properties property: Describes Machine Extension Properties. - * - * @return the properties value. - */ - public MachineExtensionProperties properties() { - return this.properties; + /** Creates an instance of MachineExtensionInner class. */ + public MachineExtensionInner() { } /** - * Set the properties property: Describes Machine Extension Properties. + * Get the innerProperties property: Describes Machine Extension Properties. * - * @param properties the properties value to set. - * @return the MachineExtensionInner object itself. + * @return the innerProperties value. */ - public MachineExtensionInner withProperties(MachineExtensionProperties properties) { - this.properties = properties; - return this; + private MachineExtensionProperties innerProperties() { + return this.innerProperties; } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -73,14 +62,240 @@ public MachineExtensionInner withTags(Map tags) { return this; } + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Map settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withSettings(Map settings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Map protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withProtectedSettings(Map protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The machine extension instance view. + * + * @return the instanceView value. + */ + public MachineExtensionInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Set the instanceView property: The machine extension instance view. + * + * @param instanceView the instanceView value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withInstanceView(MachineExtensionInstanceView instanceView) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withInstanceView(instanceView); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionProperties.java similarity index 75% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionProperties.java index 6618eec0024c0..3d1f8b5d626af 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionProperties.java @@ -2,21 +2,19 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Describes the properties of a Machine Extension. */ @Fluent public final class MachineExtensionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineExtensionProperties.class); - /* - * How the extension handler should be forced to update even if the - * extension configuration has not changed. + * How the extension handler should be forced to update even if the extension configuration has not changed. */ @JsonProperty(value = "forceUpdateTag") private String forceUpdateTag; @@ -28,8 +26,7 @@ public final class MachineExtensionProperties { private String publisher; /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Specifies the type of the extension; an example is "CustomScriptExtension". */ @JsonProperty(value = "type") private String type; @@ -41,10 +38,16 @@ public final class MachineExtensionProperties { private String typeHandlerVersion; /* - * Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension - * will not upgrade minor versions unless redeployed, even with this - * property set to true. + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once + * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set + * to true. */ @JsonProperty(value = "autoUpgradeMinorVersion") private Boolean autoUpgradeMinorVersion; @@ -53,14 +56,16 @@ public final class MachineExtensionProperties { * Json formatted public settings for the extension. */ @JsonProperty(value = "settings") - private Object settings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map settings; /* - * The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. + * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at + * all. */ @JsonProperty(value = "protectedSettings") - private Object protectedSettings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map protectedSettings; /* * The provisioning state, which only appears in the response. @@ -74,6 +79,10 @@ public final class MachineExtensionProperties { @JsonProperty(value = "instanceView") private MachineExtensionInstanceView instanceView; + /** Creates an instance of MachineExtensionProperties class. */ + public MachineExtensionProperties() { + } + /** * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension * configuration has not changed. @@ -156,6 +165,28 @@ public MachineExtensionProperties withTypeHandlerVersion(String typeHandlerVersi return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionProperties object itself. + */ + public MachineExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + /** * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless @@ -185,7 +216,7 @@ public MachineExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgrad * * @return the settings value. */ - public Object settings() { + public Map settings() { return this.settings; } @@ -195,7 +226,7 @@ public Object settings() { * @param settings the settings value to set. * @return the MachineExtensionProperties object itself. */ - public MachineExtensionProperties withSettings(Object settings) { + public MachineExtensionProperties withSettings(Map settings) { this.settings = settings; return this; } @@ -206,7 +237,7 @@ public MachineExtensionProperties withSettings(Object settings) { * * @return the protectedSettings value. */ - public Object protectedSettings() { + public Map protectedSettings() { return this.protectedSettings; } @@ -217,7 +248,7 @@ public Object protectedSettings() { * @param protectedSettings the protectedSettings value to set. * @return the MachineExtensionProperties object itself. */ - public MachineExtensionProperties withProtectedSettings(Object protectedSettings) { + public MachineExtensionProperties withProtectedSettings(Map protectedSettings) { this.protectedSettings = protectedSettings; return this; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdateProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionUpdateProperties.java similarity index 72% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdateProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionUpdateProperties.java index 0278a0b152298..18a4c376960b6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdateProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionUpdateProperties.java @@ -2,21 +2,18 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Describes the properties of a Machine Extension. */ @Fluent public final class MachineExtensionUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineExtensionUpdateProperties.class); - /* - * How the extension handler should be forced to update even if the - * extension configuration has not changed. + * How the extension handler should be forced to update even if the extension configuration has not changed. */ @JsonProperty(value = "forceUpdateTag") private String forceUpdateTag; @@ -28,8 +25,7 @@ public final class MachineExtensionUpdateProperties { private String publisher; /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Specifies the type of the extension; an example is "CustomScriptExtension". */ @JsonProperty(value = "type") private String type; @@ -41,10 +37,16 @@ public final class MachineExtensionUpdateProperties { private String typeHandlerVersion; /* - * Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension - * will not upgrade minor versions unless redeployed, even with this - * property set to true. + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once + * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set + * to true. */ @JsonProperty(value = "autoUpgradeMinorVersion") private Boolean autoUpgradeMinorVersion; @@ -53,14 +55,20 @@ public final class MachineExtensionUpdateProperties { * Json formatted public settings for the extension. */ @JsonProperty(value = "settings") - private Object settings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map settings; /* - * The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. + * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at + * all. */ @JsonProperty(value = "protectedSettings") - private Object protectedSettings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map protectedSettings; + + /** Creates an instance of MachineExtensionUpdateProperties class. */ + public MachineExtensionUpdateProperties() { + } /** * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension @@ -144,6 +152,28 @@ public MachineExtensionUpdateProperties withTypeHandlerVersion(String typeHandle return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionUpdateProperties object itself. + */ + public MachineExtensionUpdateProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + /** * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless @@ -173,7 +203,7 @@ public MachineExtensionUpdateProperties withAutoUpgradeMinorVersion(Boolean auto * * @return the settings value. */ - public Object settings() { + public Map settings() { return this.settings; } @@ -183,7 +213,7 @@ public Object settings() { * @param settings the settings value to set. * @return the MachineExtensionUpdateProperties object itself. */ - public MachineExtensionUpdateProperties withSettings(Object settings) { + public MachineExtensionUpdateProperties withSettings(Map settings) { this.settings = settings; return this; } @@ -194,7 +224,7 @@ public MachineExtensionUpdateProperties withSettings(Object settings) { * * @return the protectedSettings value. */ - public Object protectedSettings() { + public Map protectedSettings() { return this.protectedSettings; } @@ -205,7 +235,7 @@ public Object protectedSettings() { * @param protectedSettings the protectedSettings value to set. * @return the MachineExtensionUpdateProperties object itself. */ - public MachineExtensionUpdateProperties withProtectedSettings(Object protectedSettings) { + public MachineExtensionUpdateProperties withProtectedSettings(Map protectedSettings) { this.protectedSettings = protectedSettings; return this; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java index a016f351c8f63..5bcead5fd4725 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java @@ -7,23 +7,33 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; import com.azure.resourcemanager.hybridcompute.models.Identity; -import com.azure.resourcemanager.hybridcompute.models.MachineProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Describes a hybrid machine. */ @Fluent public final class MachineInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineInner.class); - /* * Hybrid Compute Machine properties */ @JsonProperty(value = "properties") - private MachineProperties properties; + private MachineProperties innerProperties; + + /* + * The list of extensions affiliated to the machine + */ + @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) + private List resources; /* * Identity for the resource. @@ -32,29 +42,31 @@ public final class MachineInner extends Resource { private Identity identity; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of MachineInner class. */ + public MachineInner() { + } + /** - * Get the properties property: Hybrid Compute Machine properties. + * Get the innerProperties property: Hybrid Compute Machine properties. * - * @return the properties value. + * @return the innerProperties value. */ - public MachineProperties properties() { - return this.properties; + private MachineProperties innerProperties() { + return this.innerProperties; } /** - * Set the properties property: Hybrid Compute Machine properties. + * Get the resources property: The list of extensions affiliated to the machine. * - * @param properties the properties value to set. - * @return the MachineInner object itself. + * @return the resources value. */ - public MachineInner withProperties(MachineProperties properties) { - this.properties = properties; - return this; + public List resources() { + return this.resources; } /** @@ -78,7 +90,7 @@ public MachineInner withIdentity(Identity identity) { } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -100,14 +112,398 @@ public MachineInner withTags(Map tags) { return this; } + /** + * Get the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. + */ + public LocationData locationData() { + return this.innerProperties() == null ? null : this.innerProperties().locationData(); + } + + /** + * Set the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @param locationData the locationData value to set. + * @return the MachineInner object itself. + */ + public MachineInner withLocationData(LocationData locationData) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withLocationData(locationData); + return this; + } + + /** + * Get the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. + */ + public AgentConfiguration agentConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().agentConfiguration(); + } + + /** + * Get the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. + */ + public ServiceStatuses serviceStatuses() { + return this.innerProperties() == null ? null : this.innerProperties().serviceStatuses(); + } + + /** + * Set the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @param serviceStatuses the serviceStatuses value to set. + * @return the MachineInner object itself. + */ + public MachineInner withServiceStatuses(ServiceStatuses serviceStatuses) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withServiceStatuses(serviceStatuses); + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().cloudMetadata(); + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineInner object itself. + */ + public MachineInner withCloudMetadata(CloudMetadata cloudMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withCloudMetadata(cloudMetadata); + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.innerProperties() == null ? null : this.innerProperties().osProfile(); + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineInner object itself. + */ + public MachineInner withOsProfile(OSProfile osProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The status of the hybrid machine agent. + * + * @return the status value. + */ + public StatusTypes status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the lastStatusChange property: The time of the last status change. + * + * @return the lastStatusChange value. + */ + public OffsetDateTime lastStatusChange() { + return this.innerProperties() == null ? null : this.innerProperties().lastStatusChange(); + } + + /** + * Get the errorDetails property: Details about the error state. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.innerProperties() == null ? null : this.innerProperties().errorDetails(); + } + + /** + * Get the agentVersion property: The hybrid machine agent full version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().agentVersion(); + } + + /** + * Get the vmId property: Specifies the hybrid machine unique ID. + * + * @return the vmId value. + */ + public String vmId() { + return this.innerProperties() == null ? null : this.innerProperties().vmId(); + } + + /** + * Set the vmId property: Specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set. + * @return the MachineInner object itself. + */ + public MachineInner withVmId(String vmId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withVmId(vmId); + return this; + } + + /** + * Get the displayName property: Specifies the hybrid machine display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the machineFqdn property: Specifies the hybrid machine FQDN. + * + * @return the machineFqdn value. + */ + public String machineFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().machineFqdn(); + } + + /** + * Get the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @return the clientPublicKey value. + */ + public String clientPublicKey() { + return this.innerProperties() == null ? null : this.innerProperties().clientPublicKey(); + } + + /** + * Set the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @param clientPublicKey the clientPublicKey value to set. + * @return the MachineInner object itself. + */ + public MachineInner withClientPublicKey(String clientPublicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withClientPublicKey(clientPublicKey); + return this; + } + + /** + * Get the osName property: The Operating System running on the hybrid machine. + * + * @return the osName value. + */ + public String osName() { + return this.innerProperties() == null ? null : this.innerProperties().osName(); + } + + /** + * Get the osVersion property: The version of Operating System running on the hybrid machine. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.innerProperties() == null ? null : this.innerProperties().osVersion(); + } + + /** + * Get the osType property: The type of Operating System (windows/linux). + * + * @return the osType value. + */ + public String osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The type of Operating System (windows/linux). + * + * @param osType the osType value to set. + * @return the MachineInner object itself. + */ + public MachineInner withOsType(String osType) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. + * + * @return the vmUuid value. + */ + public String vmUuid() { + return this.innerProperties() == null ? null : this.innerProperties().vmUuid(); + } + + /** + * Get the osSku property: Specifies the Operating System product SKU. + * + * @return the osSku value. + */ + public String osSku() { + return this.innerProperties() == null ? null : this.innerProperties().osSku(); + } + + /** + * Get the domainName property: Specifies the Windows domain name. + * + * @return the domainName value. + */ + public String domainName() { + return this.innerProperties() == null ? null : this.innerProperties().domainName(); + } + + /** + * Get the adFqdn property: Specifies the AD fully qualified display name. + * + * @return the adFqdn value. + */ + public String adFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().adFqdn(); + } + + /** + * Get the dnsFqdn property: Specifies the DNS fully qualified display name. + * + * @return the dnsFqdn value. + */ + public String dnsFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().dnsFqdn(); + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopeResourceId(); + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the MachineInner object itself. + */ + public MachineInner withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); + return this; + } + + /** + * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + public String parentClusterResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().parentClusterResourceId(); + } + + /** + * Set the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @param parentClusterResourceId the parentClusterResourceId value to set. + * @return the MachineInner object itself. + */ + public MachineInner withParentClusterResourceId(String parentClusterResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withParentClusterResourceId(parentClusterResourceId); + return this; + } + + /** + * Get the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @return the mssqlDiscovered value. + */ + public String mssqlDiscovered() { + return this.innerProperties() == null ? null : this.innerProperties().mssqlDiscovered(); + } + + /** + * Set the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @param mssqlDiscovered the mssqlDiscovered value to set. + * @return the MachineInner object itself. + */ + public MachineInner withMssqlDiscovered(String mssqlDiscovered) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withMssqlDiscovered(mssqlDiscovered); + return this; + } + + /** + * Get the detectedProperties property: Detected properties from the machine. + * + * @return the detectedProperties value. + */ + public Map detectedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().detectedProperties(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (resources() != null) { + resources().forEach(e -> e.validate()); } if (identity() != null) { identity().validate(); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineProperties.java similarity index 69% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineProperties.java index 050aba734e6cb..6dc0677f118f9 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineProperties.java @@ -2,12 +2,17 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; @@ -16,18 +21,34 @@ /** Describes the properties of a hybrid machine. */ @Fluent public final class MachineProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineProperties.class); - /* * Metadata pertaining to the geographic location of the resource. */ @JsonProperty(value = "locationData") private LocationData locationData; + /* + * Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + */ + @JsonProperty(value = "agentConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private AgentConfiguration agentConfiguration; + + /* + * Statuses of dependent services that are reported back to ARM. + */ + @JsonProperty(value = "serviceStatuses") + private ServiceStatuses serviceStatuses; + + /* + * The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + */ + @JsonProperty(value = "cloudMetadata") + private CloudMetadata cloudMetadata; + /* * Specifies the operating system settings for the hybrid machine. */ - @JsonProperty(value = "osProfile", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "osProfile") private OSProfile osProfile; /* @@ -79,8 +100,7 @@ public final class MachineProperties { private String machineFqdn; /* - * Public Key that the client provides to be used during initial resource - * onboarding + * Public Key that the client provides to be used during initial resource onboarding */ @JsonProperty(value = "clientPublicKey") private String clientPublicKey; @@ -98,16 +118,16 @@ public final class MachineProperties { private String osVersion; /* - * Specifies the Arc Machine's unique SMBIOS ID + * The type of Operating System (windows/linux). */ - @JsonProperty(value = "vmUuid", access = JsonProperty.Access.WRITE_ONLY) - private String vmUuid; + @JsonProperty(value = "osType") + private String osType; /* - * Machine Extensions information + * Specifies the Arc Machine's unique SMBIOS ID */ - @JsonProperty(value = "extensions") - private List extensions; + @JsonProperty(value = "vmUuid", access = JsonProperty.Access.WRITE_ONLY) + private String vmUuid; /* * Specifies the Operating System product SKU. @@ -134,25 +154,34 @@ public final class MachineProperties { private String dnsFqdn; /* - * The resource id of the private link scope this machine is assigned to, - * if any. + * The resource id of the private link scope this machine is assigned to, if any. */ @JsonProperty(value = "privateLinkScopeResourceId") private String privateLinkScopeResourceId; /* - * The resource id of the parent cluster (Azure HCI) this machine is - * assigned to, if any. + * The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. */ @JsonProperty(value = "parentClusterResourceId") private String parentClusterResourceId; + /* + * Specifies whether any MS SQL instance is discovered on the machine. + */ + @JsonProperty(value = "mssqlDiscovered") + private String mssqlDiscovered; + /* * Detected properties from the machine. */ @JsonProperty(value = "detectedProperties", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map detectedProperties; + /** Creates an instance of MachineProperties class. */ + public MachineProperties() { + } + /** * Get the locationData property: Metadata pertaining to the geographic location of the resource. * @@ -173,6 +202,56 @@ public MachineProperties withLocationData(LocationData locationData) { return this; } + /** + * Get the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. + */ + public AgentConfiguration agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Get the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. + */ + public ServiceStatuses serviceStatuses() { + return this.serviceStatuses; + } + + /** + * Set the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @param serviceStatuses the serviceStatuses value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withServiceStatuses(ServiceStatuses serviceStatuses) { + this.serviceStatuses = serviceStatuses; + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.cloudMetadata; + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withCloudMetadata(CloudMetadata cloudMetadata) { + this.cloudMetadata = cloudMetadata; + return this; + } + /** * Get the osProfile property: Specifies the operating system settings for the hybrid machine. * @@ -182,6 +261,17 @@ public OSProfile osProfile() { return this.osProfile; } + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + /** * Get the provisioningState property: The provisioning state, which only appears in the response. * @@ -306,32 +396,32 @@ public String osVersion() { } /** - * Get the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. + * Get the osType property: The type of Operating System (windows/linux). * - * @return the vmUuid value. + * @return the osType value. */ - public String vmUuid() { - return this.vmUuid; + public String osType() { + return this.osType; } /** - * Get the extensions property: Machine Extensions information. + * Set the osType property: The type of Operating System (windows/linux). * - * @return the extensions value. + * @param osType the osType value to set. + * @return the MachineProperties object itself. */ - public List extensions() { - return this.extensions; + public MachineProperties withOsType(String osType) { + this.osType = osType; + return this; } /** - * Set the extensions property: Machine Extensions information. + * Get the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. * - * @param extensions the extensions value to set. - * @return the MachineProperties object itself. + * @return the vmUuid value. */ - public MachineProperties withExtensions(List extensions) { - this.extensions = extensions; - return this; + public String vmUuid() { + return this.vmUuid; } /** @@ -414,6 +504,26 @@ public MachineProperties withParentClusterResourceId(String parentClusterResourc return this; } + /** + * Get the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @return the mssqlDiscovered value. + */ + public String mssqlDiscovered() { + return this.mssqlDiscovered; + } + + /** + * Set the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @param mssqlDiscovered the mssqlDiscovered value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withMssqlDiscovered(String mssqlDiscovered) { + this.mssqlDiscovered = mssqlDiscovered; + return this; + } + /** * Get the detectedProperties property: Detected properties from the machine. * @@ -432,11 +542,17 @@ public void validate() { if (locationData() != null) { locationData().validate(); } + if (agentConfiguration() != null) { + agentConfiguration().validate(); + } + if (serviceStatuses() != null) { + serviceStatuses().validate(); + } + if (cloudMetadata() != null) { + cloudMetadata().validate(); + } if (osProfile() != null) { osProfile().validate(); } - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdateProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineUpdateProperties.java similarity index 61% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdateProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineUpdateProperties.java index 08a318d410429..ac9038f4ded67 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdateProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineUpdateProperties.java @@ -2,18 +2,17 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the ARM updatable properties of a hybrid machine. */ @Fluent public final class MachineUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineUpdateProperties.class); - /* * Metadata pertaining to the geographic location of the resource. */ @@ -21,19 +20,33 @@ public final class MachineUpdateProperties { private LocationData locationData; /* - * The resource id of the parent cluster (Azure HCI) this machine is - * assigned to, if any. + * Specifies the operating system settings for the hybrid machine. + */ + @JsonProperty(value = "osProfile") + private OSProfile osProfile; + + /* + * The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + */ + @JsonProperty(value = "cloudMetadata") + private CloudMetadata cloudMetadata; + + /* + * The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. */ @JsonProperty(value = "parentClusterResourceId") private String parentClusterResourceId; /* - * The resource id of the private link scope this machine is assigned to, - * if any. + * The resource id of the private link scope this machine is assigned to, if any. */ @JsonProperty(value = "privateLinkScopeResourceId") private String privateLinkScopeResourceId; + /** Creates an instance of MachineUpdateProperties class. */ + public MachineUpdateProperties() { + } + /** * Get the locationData property: Metadata pertaining to the geographic location of the resource. * @@ -54,6 +67,46 @@ public MachineUpdateProperties withLocationData(LocationData locationData) { return this; } + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.cloudMetadata; + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withCloudMetadata(CloudMetadata cloudMetadata) { + this.cloudMetadata = cloudMetadata; + return this; + } + /** * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is * assigned to, if any. @@ -107,5 +160,11 @@ public void validate() { if (locationData() != null) { locationData().validate(); } + if (osProfile() != null) { + osProfile().validate(); + } + if (cloudMetadata() != null) { + cloudMetadata().validate(); + } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java index cd90cfe0f799d..3db00f32a5f0c 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.models.OperationValueDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the properties of a Compute Operation value. */ @Fluent public final class OperationValueInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationValueInner.class); - /* * The origin of the compute operation. */ @@ -33,6 +29,16 @@ public final class OperationValueInner { @JsonProperty(value = "display") private OperationValueDisplay display; + /* + * This property indicates if the operation is an action or a data action + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /** Creates an instance of OperationValueInner class. */ + public OperationValueInner() { + } + /** * Get the origin property: The origin of the compute operation. * @@ -71,6 +77,15 @@ public OperationValueInner withDisplay(OperationValueDisplay display) { return this; } + /** + * Get the isDataAction property: This property indicates if the operation is an action or a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + /** * Validates the instance. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java new file mode 100644 index 0000000000000..d92448aa83ca9 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.AssessmentModeTypes; +import com.azure.resourcemanager.hybridcompute.models.PatchModeTypes; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the patch settings. */ +@Fluent +public final class PatchSettings { + /* + * Specifies the assessment mode. + */ + @JsonProperty(value = "assessmentMode") + private AssessmentModeTypes assessmentMode; + + /* + * Specifies the patch mode. + */ + @JsonProperty(value = "patchMode") + private PatchModeTypes patchMode; + + /** Creates an instance of PatchSettings class. */ + public PatchSettings() { + } + + /** + * Get the assessmentMode property: Specifies the assessment mode. + * + * @return the assessmentMode value. + */ + public AssessmentModeTypes assessmentMode() { + return this.assessmentMode; + } + + /** + * Set the assessmentMode property: Specifies the assessment mode. + * + * @param assessmentMode the assessmentMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withAssessmentMode(AssessmentModeTypes assessmentMode) { + this.assessmentMode = assessmentMode; + return this; + } + + /** + * Get the patchMode property: Specifies the patch mode. + * + * @return the patchMode value. + */ + public PatchModeTypes patchMode() { + return this.patchMode; + } + + /** + * Set the patchMode property: Specifies the patch mode. + * + * @param patchMode the patchMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withPatchMode(PatchModeTypes patchMode) { + this.patchMode = patchMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java index 993acf042f404..26906cb0a4f50 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java @@ -7,16 +7,12 @@ 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.hybridcompute.models.PrivateEndpointConnectionProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A private endpoint connection. */ @Fluent public final class PrivateEndpointConnectionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); - /* * Resource properties. */ @@ -24,11 +20,15 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { private PrivateEndpointConnectionProperties properties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + /** * Get the properties property: Resource properties. * @@ -50,7 +50,7 @@ public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionPr } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java index b6bd5325e6e10..de347adac351e 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java @@ -7,16 +7,12 @@ 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.hybridcompute.models.PrivateLinkResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A private link resource. */ @Fluent public final class PrivateLinkResourceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); - /* * Resource properties. */ @@ -24,11 +20,15 @@ public final class PrivateLinkResourceInner extends ProxyResource { private PrivateLinkResourceProperties properties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of PrivateLinkResourceInner class. */ + public PrivateLinkResourceInner() { + } + /** * Get the properties property: Resource properties. * @@ -50,7 +50,7 @@ public PrivateLinkResourceInner withProperties(PrivateLinkResourceProperties pro } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkScopeValidationDetailsInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkScopeValidationDetailsInner.java index 7f8e4adf6f7b7..901f52dbb5902 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkScopeValidationDetailsInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkScopeValidationDetailsInner.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.models.ConnectionDetail; import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The PrivateLinkScopeValidationDetails model. */ @Fluent public final class PrivateLinkScopeValidationDetailsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkScopeValidationDetailsInner.class); - /* * Azure resource Id */ @@ -24,8 +20,8 @@ public final class PrivateLinkScopeValidationDetailsInner { private String id; /* - * Indicates whether machines associated with the private link scope can - * also use public Azure Arc service endpoints. + * Indicates whether machines associated with the private link scope can also use public Azure Arc service + * endpoints. */ @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccessType publicNetworkAccess; @@ -36,6 +32,10 @@ public final class PrivateLinkScopeValidationDetailsInner { @JsonProperty(value = "connectionDetails") private List connectionDetails; + /** Creates an instance of PrivateLinkScopeValidationDetailsInner class. */ + public PrivateLinkScopeValidationDetailsInner() { + } + /** * Get the id property: Azure resource Id. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java new file mode 100644 index 0000000000000..f02e8074fa5b2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.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.hybridcompute.fluent.ExtensionMetadatasClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.azure.resourcemanager.hybridcompute.models.ExtensionValueListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExtensionMetadatasClient. */ +public final class ExtensionMetadatasClientImpl implements ExtensionMetadatasClient { + /** The proxy service used to perform REST calls. */ + private final ExtensionMetadatasService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of ExtensionMetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtensionMetadatasClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(ExtensionMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientExtensionMetadatas to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + private interface ExtensionMetadatasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers" + + "/{publisher}/extensionTypes/{extensionType}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("publisher") String publisher, + @PathParam("extensionType") String extensionType, + @PathParam("version") String version, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers" + + "/{publisher}/extensionTypes/{extensionType}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("publisher") String publisher, + @PathParam("extensionType") String extensionType, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisher, String extensionType, String version) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + publisher, + extensionType, + version, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisher, String extensionType, String version, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + publisher, + extensionType, + version, + accept, + context); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String publisher, String extensionType, String version) { + return getWithResponseAsync(location, publisher, extensionType, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context) { + return getWithResponseAsync(location, publisher, extensionType, version, context).block(); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionValueInner get(String location, String publisher, String extensionType, String version) { + return getWithResponse(location, publisher, extensionType, version, Context.NONE).getValue(); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publisher, String extensionType) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + publisher, + extensionType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publisher, String extensionType, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + publisher, + extensionType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String publisher, String extensionType) { + return new PagedFlux<>(() -> listSinglePageAsync(location, publisher, extensionType)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String publisher, String extensionType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(location, publisher, extensionType, context)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String publisher, String extensionType) { + return new PagedIterable<>(listAsync(location, publisher, extensionType)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String location, String publisher, String extensionType, Context context) { + return new PagedIterable<>(listAsync(location, publisher, extensionType, context)); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java new file mode 100644 index 0000000000000..bbcaeb86922d2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.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.hybridcompute.fluent.ExtensionMetadatasClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.azure.resourcemanager.hybridcompute.models.ExtensionMetadatas; +import com.azure.resourcemanager.hybridcompute.models.ExtensionValue; + +public final class ExtensionMetadatasImpl implements ExtensionMetadatas { + private static final ClientLogger LOGGER = new ClientLogger(ExtensionMetadatasImpl.class); + + private final ExtensionMetadatasClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public ExtensionMetadatasImpl( + ExtensionMetadatasClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(location, publisher, extensionType, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtensionValueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExtensionValue get(String location, String publisher, String extensionType, String version) { + ExtensionValueInner inner = this.serviceClient().get(location, publisher, extensionType, version); + if (inner != null) { + return new ExtensionValueImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String location, String publisher, String extensionType) { + PagedIterable inner = this.serviceClient().list(location, publisher, extensionType); + return Utils.mapPage(inner, inner1 -> new ExtensionValueImpl(inner1, this.manager())); + } + + public PagedIterable list( + String location, String publisher, String extensionType, Context context) { + PagedIterable inner = + this.serviceClient().list(location, publisher, extensionType, context); + return Utils.mapPage(inner, inner1 -> new ExtensionValueImpl(inner1, this.manager())); + } + + private ExtensionMetadatasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java new file mode 100644 index 0000000000000..a39bbab312c23 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.azure.resourcemanager.hybridcompute.models.ExtensionValue; + +public final class ExtensionValueImpl implements ExtensionValue { + private ExtensionValueInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + ExtensionValueImpl( + ExtensionValueInner innerObject, com.azure.resourcemanager.hybridcompute.HybridComputeManager 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 version() { + return this.innerModel().version(); + } + + public String extensionType() { + return this.innerModel().extensionType(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public ExtensionValueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientBuilder.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientBuilder.java index b082d06e50bdd..b38ce59ecf9f9 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientBuilder.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public HybridComputeManagementClientBuilder environment(AzureEnvironment environ } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the HybridComputeManagementClientBuilder. */ - public HybridComputeManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public HybridComputeManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the HybridComputeManagementClientBuilder. */ - public HybridComputeManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public HybridComputeManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -120,27 +119,26 @@ public HybridComputeManagementClientBuilder serializerAdapter(SerializerAdapter * @return an instance of HybridComputeManagementClientImpl. */ public HybridComputeManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + 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(); HybridComputeManagementClientImpl client = new HybridComputeManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java index 0f4f2680c64c4..d72e69841ce5c 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java @@ -15,12 +15,14 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.hybridcompute.fluent.ExtensionMetadatasClient; import com.azure.resourcemanager.hybridcompute.fluent.HybridComputeManagementClient; import com.azure.resourcemanager.hybridcompute.fluent.MachineExtensionsClient; import com.azure.resourcemanager.hybridcompute.fluent.MachinesClient; @@ -28,21 +30,19 @@ import com.azure.resourcemanager.hybridcompute.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.hybridcompute.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.hybridcompute.fluent.PrivateLinkScopesClient; +import com.azure.resourcemanager.hybridcompute.fluent.ResourceProvidersClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the HybridComputeManagementClientImpl type. */ @ServiceClient(builder = HybridComputeManagementClientBuilder.class) public final class HybridComputeManagementClientImpl implements HybridComputeManagementClient { - private final ClientLogger logger = new ClientLogger(HybridComputeManagementClientImpl.class); - /** The ID of the target subscription. */ private final String subscriptionId; @@ -139,6 +139,30 @@ public MachineExtensionsClient getMachineExtensions() { return this.machineExtensions; } + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The ExtensionMetadatasClient object to access its operations. */ + private final ExtensionMetadatasClient extensionMetadatas; + + /** + * Gets the ExtensionMetadatasClient object to access its operations. + * + * @return the ExtensionMetadatasClient object. + */ + public ExtensionMetadatasClient getExtensionMetadatas() { + return this.extensionMetadatas; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -209,9 +233,11 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-25-preview"; + this.apiVersion = "2022-08-11-preview"; this.machines = new MachinesClientImpl(this); this.machineExtensions = new MachineExtensionsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.extensionMetadatas = new ExtensionMetadatasClientImpl(this); this.operations = new OperationsClientImpl(this); this.privateLinkScopes = new PrivateLinkScopesClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); @@ -234,10 +260,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -301,7 +324,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -360,4 +383,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(HybridComputeManagementClientImpl.class); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputePrivateLinkScopeImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputePrivateLinkScopeImpl.java index c6159324195a6..7f44980ec6514 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputePrivateLinkScopeImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputePrivateLinkScopeImpl.java @@ -63,6 +63,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public HybridComputePrivateLinkScopeInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java index 85f99ca416858..41a707a762783 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java @@ -9,9 +9,8 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdate; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; import java.util.Collections; import java.util.Map; @@ -46,14 +45,60 @@ public Map tags() { } } - public MachineExtensionProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String typeHandlerVersion() { + return this.innerModel().typeHandlerVersion(); + } + + public Boolean enableAutomaticUpgrade() { + return this.innerModel().enableAutomaticUpgrade(); + } + + public Boolean autoUpgradeMinorVersion() { + return this.innerModel().autoUpgradeMinorVersion(); + } + + public Map settings() { + Map inner = this.innerModel().settings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map protectedSettings() { + Map inner = this.innerModel().protectedSettings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public MachineExtensionInstanceView instanceView() { + return this.innerModel().instanceView(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -62,6 +107,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public MachineExtensionInner innerModel() { return this.innerObject; } @@ -181,13 +230,88 @@ public MachineExtensionImpl withTags(Map tags) { } } - public MachineExtensionImpl withProperties(MachineExtensionProperties properties) { - this.innerModel().withProperties(properties); + public MachineExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } else { + this.updateExtensionParameters.withForceUpdateTag(forceUpdateTag); + return this; + } + } + + public MachineExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.innerModel().withPublisher(publisher); + return this; + } else { + this.updateExtensionParameters.withPublisher(publisher); + return this; + } + } + + public MachineExtensionImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public MachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.innerModel().withTypeHandlerVersion(typeHandlerVersion); + return this; + } else { + this.updateExtensionParameters.withTypeHandlerVersion(typeHandlerVersion); + return this; + } + } + + public MachineExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (isInCreateMode()) { + this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } else { + this.updateExtensionParameters.withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + } + + public MachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } else { + this.updateExtensionParameters.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + } + + public MachineExtensionImpl withSettings(Map settings) { + if (isInCreateMode()) { + this.innerModel().withSettings(settings); + return this; + } else { + this.updateExtensionParameters.withSettings(settings); + return this; + } + } + + public MachineExtensionImpl withProtectedSettings(Map protectedSettings) { + if (isInCreateMode()) { + this.innerModel().withProtectedSettings(protectedSettings); + return this; + } else { + this.updateExtensionParameters.withProtectedSettings(protectedSettings); + return this; + } + } + + public MachineExtensionImpl withInstanceView(MachineExtensionInstanceView instanceView) { + this.innerModel().withInstanceView(instanceView); return this; } - public MachineExtensionImpl withProperties(MachineExtensionUpdateProperties properties) { - this.updateExtensionParameters.withProperties(properties); + public MachineExtensionImpl withType(String type) { + this.updateExtensionParameters.withType(type); return this; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsClientImpl.java index b6beaeb5f7bf8..182c265c38dad 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsClientImpl.java @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridcompute.fluent.MachineExtensionsClient; @@ -43,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in MachineExtensionsClient. */ public final class MachineExtensionsClientImpl implements MachineExtensionsClient { - private final ClientLogger logger = new ClientLogger(MachineExtensionsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final MachineExtensionsService service; @@ -172,7 +169,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -234,7 +231,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -296,9 +293,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link PollerFlux} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MachineExtensionInner> beginCreateOrUpdateAsync( String resourceGroupName, String machineName, String extensionName, MachineExtensionInner extensionParameters) { Mono>> mono = @@ -310,7 +307,7 @@ private PollerFlux, MachineExtensionInner> beg this.client.getHttpPipeline(), MachineExtensionInner.class, MachineExtensionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -324,9 +321,9 @@ private PollerFlux, MachineExtensionInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link PollerFlux} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MachineExtensionInner> beginCreateOrUpdateAsync( String resourceGroupName, String machineName, @@ -353,9 +350,9 @@ private PollerFlux, MachineExtensionInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link SyncPoller} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, MachineExtensionInner> beginCreateOrUpdate( String resourceGroupName, String machineName, String extensionName, MachineExtensionInner extensionParameters) { return beginCreateOrUpdateAsync(resourceGroupName, machineName, extensionName, extensionParameters) @@ -373,9 +370,9 @@ public SyncPoller, MachineExtensionInner> begi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link SyncPoller} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, MachineExtensionInner> beginCreateOrUpdate( String resourceGroupName, String machineName, @@ -396,7 +393,7 @@ public SyncPoller, MachineExtensionInner> begi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -417,7 +414,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -482,7 +479,7 @@ public MachineExtensionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -547,7 +544,7 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -609,9 +606,9 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link PollerFlux} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MachineExtensionInner> beginUpdateAsync( String resourceGroupName, String machineName, @@ -626,7 +623,7 @@ private PollerFlux, MachineExtensionInner> beg this.client.getHttpPipeline(), MachineExtensionInner.class, MachineExtensionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -640,9 +637,9 @@ private PollerFlux, MachineExtensionInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link PollerFlux} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MachineExtensionInner> beginUpdateAsync( String resourceGroupName, String machineName, @@ -668,9 +665,9 @@ private PollerFlux, MachineExtensionInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link SyncPoller} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, MachineExtensionInner> beginUpdate( String resourceGroupName, String machineName, @@ -690,9 +687,9 @@ public SyncPoller, MachineExtensionInner> begi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return the {@link SyncPoller} for polling of describes a Machine Extension. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, MachineExtensionInner> beginUpdate( String resourceGroupName, String machineName, @@ -713,7 +710,7 @@ public SyncPoller, MachineExtensionInner> begi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -737,7 +734,7 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -804,7 +801,7 @@ public MachineExtensionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -858,7 +855,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -908,15 +905,16 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String machineName, String extensionName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, machineName, extensionName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -929,9 +927,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String machineName, String extensionName, Context context) { context = this.client.mergeContext(context); @@ -951,9 +949,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String machineName, String extensionName) { return beginDeleteAsync(resourceGroupName, machineName, extensionName).getSyncPoller(); @@ -969,9 +967,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String machineName, String extensionName, Context context) { return beginDeleteAsync(resourceGroupName, machineName, extensionName, context).getSyncPoller(); @@ -986,7 +984,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String machineName, String extensionName) { @@ -1005,7 +1003,7 @@ private Mono deleteAsync(String resourceGroupName, String machineName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -1055,7 +1053,7 @@ public void delete(String resourceGroupName, String machineName, String extensio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -1109,7 +1107,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -1159,19 +1157,12 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String machineName, String extensionName) { return getWithResponseAsync(resourceGroupName, machineName, extensionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1180,14 +1171,16 @@ private Mono getAsync(String resourceGroupName, String ma * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the machine containing the extension. * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MachineExtensionInner get(String resourceGroupName, String machineName, String extensionName) { - return getAsync(resourceGroupName, machineName, extensionName).block(); + public Response getWithResponse( + String resourceGroupName, String machineName, String extensionName, Context context) { + return getWithResponseAsync(resourceGroupName, machineName, extensionName, context).block(); } /** @@ -1196,16 +1189,14 @@ public MachineExtensionInner get(String resourceGroupName, String machineName, S * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the machine containing the extension. * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String machineName, String extensionName, Context context) { - return getWithResponseAsync(resourceGroupName, machineName, extensionName, context).block(); + public MachineExtensionInner get(String resourceGroupName, String machineName, String extensionName) { + return getWithResponse(resourceGroupName, machineName, extensionName, Context.NONE).getValue(); } /** @@ -1217,7 +1208,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -1277,7 +1269,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -1333,7 +1326,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String machineName, String expand) { @@ -1350,7 +1343,7 @@ private PagedFlux listAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String machineName) { @@ -1370,7 +1363,7 @@ private PagedFlux listAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -1388,7 +1381,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String machineName) { @@ -1406,7 +1399,7 @@ public PagedIterable list(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -1417,11 +1410,13 @@ public PagedIterable list( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1452,12 +1447,14 @@ private Mono> listNextSinglePageAsync(Strin /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsImpl.java index 5a223822b4e1e..f51b4cace0f1a 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; import com.azure.resourcemanager.hybridcompute.models.MachineExtension; import com.azure.resourcemanager.hybridcompute.models.MachineExtensions; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class MachineExtensionsImpl implements MachineExtensions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineExtensionsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(MachineExtensionsImpl.class); private final MachineExtensionsClient innerClient; @@ -37,15 +36,6 @@ public void delete(String resourceGroupName, String machineName, String extensio this.serviceClient().delete(resourceGroupName, machineName, extensionName, context); } - public MachineExtension get(String resourceGroupName, String machineName, String extensionName) { - MachineExtensionInner inner = this.serviceClient().get(resourceGroupName, machineName, extensionName); - if (inner != null) { - return new MachineExtensionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String machineName, String extensionName, Context context) { Response inner = @@ -61,6 +51,15 @@ public Response getWithResponse( } } + public MachineExtension get(String resourceGroupName, String machineName, String extensionName) { + MachineExtensionInner inner = this.serviceClient().get(resourceGroupName, machineName, extensionName); + if (inner != null) { + return new MachineExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable list(String resourceGroupName, String machineName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, machineName); return Utils.mapPage(inner, inner1 -> new MachineExtensionImpl(inner1, this.manager())); @@ -76,7 +75,7 @@ public PagedIterable list( public MachineExtension getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -84,14 +83,14 @@ public MachineExtension getById(String id) { } String machineName = Utils.getValueFromIdByName(id, "machines"); if (machineName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); } String extensionName = Utils.getValueFromIdByName(id, "extensions"); if (extensionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); @@ -102,7 +101,7 @@ public MachineExtension getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -110,14 +109,14 @@ public Response getByIdWithResponse(String id, Context context } String machineName = Utils.getValueFromIdByName(id, "machines"); if (machineName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); } String extensionName = Utils.getValueFromIdByName(id, "extensions"); if (extensionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); @@ -128,7 +127,7 @@ public Response getByIdWithResponse(String id, Context context public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -136,14 +135,14 @@ public void deleteById(String id) { } String machineName = Utils.getValueFromIdByName(id, "machines"); if (machineName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); } String extensionName = Utils.getValueFromIdByName(id, "extensions"); if (extensionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); @@ -154,7 +153,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -162,14 +161,14 @@ public void deleteByIdWithResponse(String id, Context context) { } String machineName = Utils.getValueFromIdByName(id, "machines"); if (machineName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'machines'.", id))); } String extensionName = Utils.getValueFromIdByName(id, "extensions"); if (extensionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java index f1e216d83e41c..c3818b80693a7 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java @@ -5,12 +5,23 @@ package com.azure.resourcemanager.hybridcompute.implementation; import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; import com.azure.resourcemanager.hybridcompute.models.Identity; +import com.azure.resourcemanager.hybridcompute.models.LocationData; import com.azure.resourcemanager.hybridcompute.models.Machine; -import com.azure.resourcemanager.hybridcompute.models.MachineProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtension; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; +import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class MachineImpl implements Machine { private MachineInner innerObject; @@ -47,8 +58,18 @@ public Map tags() { } } - public MachineProperties properties() { - return this.innerModel().properties(); + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new MachineExtensionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } } public Identity identity() { @@ -59,6 +80,120 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public LocationData locationData() { + return this.innerModel().locationData(); + } + + public AgentConfiguration agentConfiguration() { + return this.innerModel().agentConfiguration(); + } + + public ServiceStatuses serviceStatuses() { + return this.innerModel().serviceStatuses(); + } + + public CloudMetadata cloudMetadata() { + return this.innerModel().cloudMetadata(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public StatusTypes status() { + return this.innerModel().status(); + } + + public OffsetDateTime lastStatusChange() { + return this.innerModel().lastStatusChange(); + } + + public List errorDetails() { + List inner = this.innerModel().errorDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String agentVersion() { + return this.innerModel().agentVersion(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String machineFqdn() { + return this.innerModel().machineFqdn(); + } + + public String clientPublicKey() { + return this.innerModel().clientPublicKey(); + } + + public String osName() { + return this.innerModel().osName(); + } + + public String osVersion() { + return this.innerModel().osVersion(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String vmUuid() { + return this.innerModel().vmUuid(); + } + + public String osSku() { + return this.innerModel().osSku(); + } + + public String domainName() { + return this.innerModel().domainName(); + } + + public String adFqdn() { + return this.innerModel().adFqdn(); + } + + public String dnsFqdn() { + return this.innerModel().dnsFqdn(); + } + + public String privateLinkScopeResourceId() { + return this.innerModel().privateLinkScopeResourceId(); + } + + public String parentClusterResourceId() { + return this.innerModel().parentClusterResourceId(); + } + + public String mssqlDiscovered() { + return this.innerModel().mssqlDiscovered(); + } + + public Map detectedProperties() { + Map inner = this.innerModel().detectedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public MachineInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java index eb4ecdca94a77..4b22138baa09a 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java @@ -26,7 +26,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.MachinesClient; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; import com.azure.resourcemanager.hybridcompute.models.InstanceViewTypes; @@ -35,8 +34,6 @@ /** An instance of this class provides access to all the operations defined in MachinesClient. */ public final class MachinesClientImpl implements MachinesClient { - private final ClientLogger logger = new ClientLogger(MachinesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final MachinesService service; @@ -138,14 +135,14 @@ Mono> listBySubscriptionNext( } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String machineName) { @@ -185,7 +182,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -193,7 +190,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -231,48 +228,48 @@ private Mono> deleteWithResponseAsync( } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String machineName) { - return deleteWithResponseAsync(resourceGroupName, machineName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, machineName).flatMap(ignored -> Mono.empty()); } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 machineName) { - deleteAsync(resourceGroupName, machineName).block(); + public Response deleteWithResponse(String resourceGroupName, String machineName, Context context) { + return deleteWithResponseAsync(resourceGroupName, machineName, context).block(); } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String machineName, Context context) { - return deleteWithResponseAsync(resourceGroupName, machineName, context).block(); + public void delete(String resourceGroupName, String machineName) { + deleteWithResponse(resourceGroupName, machineName, Context.NONE); } /** @@ -284,7 +281,7 @@ public Response deleteWithResponse(String resourceGroupName, String machin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a hybrid machine. + * @return describes a hybrid machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -335,7 +332,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a hybrid machine. + * @return describes a hybrid machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -378,48 +375,16 @@ private Mono> getByResourceGroupWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. - * @param expand The expand expression to apply on the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a hybrid machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String machineName, InstanceViewTypes expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, machineName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves information about the model view or the instance view of a hybrid machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param machineName The name of the hybrid machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a hybrid machine. + * @return describes a hybrid machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String machineName) { final InstanceViewTypes expand = null; return getByResourceGroupWithResponseAsync(resourceGroupName, machineName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -427,15 +392,17 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a hybrid machine. + * @return describes a hybrid machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MachineInner getByResourceGroup(String resourceGroupName, String machineName) { - final InstanceViewTypes expand = null; - return getByResourceGroupAsync(resourceGroupName, machineName, expand).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String machineName, InstanceViewTypes expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, machineName, expand, context).block(); } /** @@ -443,17 +410,15 @@ public MachineInner getByResourceGroup(String resourceGroupName, String machineN * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a hybrid machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String machineName, InstanceViewTypes expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, machineName, expand, context).block(); + public MachineInner getByResourceGroup(String resourceGroupName, String machineName) { + final InstanceViewTypes expand = null; + return getByResourceGroupWithResponse(resourceGroupName, machineName, expand, Context.NONE).getValue(); } /** @@ -464,7 +429,8 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -517,7 +483,8 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -567,7 +534,7 @@ private Mono> listByResourceGroupSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -585,7 +552,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -602,7 +569,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -618,7 +585,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -631,7 +598,8 @@ public PagedIterable listByResourceGroup(String resourceGroupName, * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -678,7 +646,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -720,7 +689,7 @@ private Mono> listSinglePageAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -736,7 +705,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -750,7 +719,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -765,7 +734,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -775,11 +744,13 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 the List hybrid machine operation response. + * @return the List hybrid machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -811,12 +782,14 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 the List hybrid machine operation response. + * @return the List hybrid machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { @@ -847,11 +820,13 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 the List hybrid machine operation response. + * @return the List hybrid machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -883,12 +858,14 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 the List hybrid machine operation response. + * @return the List hybrid machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesImpl.java index 920a89bcaeee0..8eb136c67096f 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesImpl.java @@ -14,10 +14,9 @@ import com.azure.resourcemanager.hybridcompute.models.InstanceViewTypes; import com.azure.resourcemanager.hybridcompute.models.Machine; import com.azure.resourcemanager.hybridcompute.models.Machines; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class MachinesImpl implements Machines { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachinesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(MachinesImpl.class); private final MachinesClient innerClient; @@ -29,21 +28,13 @@ public MachinesImpl( this.serviceManager = serviceManager; } - public void deleteByResourceGroup(String resourceGroupName, String machineName) { - this.serviceClient().delete(resourceGroupName, machineName); - } - - public Response deleteWithResponse(String resourceGroupName, String machineName, Context context) { + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String machineName, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, machineName, context); } - public Machine getByResourceGroup(String resourceGroupName, String machineName) { - MachineInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, machineName); - if (inner != null) { - return new MachineImpl(inner, this.manager()); - } else { - return null; - } + public void deleteByResourceGroup(String resourceGroupName, String machineName) { + this.serviceClient().delete(resourceGroupName, machineName); } public Response getByResourceGroupWithResponse( @@ -61,6 +52,15 @@ public Response getByResourceGroupWithResponse( } } + public Machine getByResourceGroup(String resourceGroupName, String machineName) { + MachineInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, machineName); + if (inner != null) { + return new MachineImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return Utils.mapPage(inner, inner1 -> new MachineImpl(inner1, this.manager())); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java index df3cc1e8dd4f5..323ba788ca213 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java @@ -31,6 +31,10 @@ public OperationValueDisplay display() { return this.innerModel().display(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public OperationValueInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationsClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationsClientImpl.java index 9a596b6fb9def..f9b5b91e8c043 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationsClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationsClientImpl.java @@ -24,7 +24,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.OperationsClient; import com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner; import com.azure.resourcemanager.hybridcompute.models.OperationListResult; @@ -32,8 +31,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -74,7 +71,8 @@ Mono> list( * * @throws 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 hybrid compute operations. + * @return a list of hybrid compute operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -102,7 +100,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of hybrid compute operations. + * @return a list of hybrid compute operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -127,7 +126,7 @@ private Mono> listSinglePageAsync(Context con * * @throws 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 hybrid compute operations. + * @return a list of hybrid compute operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -141,7 +140,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of hybrid compute operations. + * @return a list of hybrid compute operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -153,7 +152,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of hybrid compute operations. + * @return a list of hybrid compute operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -167,7 +166,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of hybrid compute operations. + * @return a list of hybrid compute operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationsImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationsImpl.java index 86b8487c76ea0..bb51706c3be29 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationsImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner; import com.azure.resourcemanager.hybridcompute.models.OperationValue; import com.azure.resourcemanager.hybridcompute.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionImpl.java index 8f5c8bc4e733a..dfe0fcdbafa07 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionImpl.java @@ -36,6 +36,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public String resourceGroupName() { + return resourceGroupName; + } + public PrivateEndpointConnectionInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsClientImpl.java index 51ebe5959e09d..cdfe3efc1bcb5 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsClientImpl.java @@ -29,7 +29,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridcompute.fluent.PrivateEndpointConnectionsClient; @@ -41,8 +40,6 @@ /** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PrivateEndpointConnectionsService service; @@ -153,7 +150,7 @@ Mono> listByPrivateLinkScopeNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -210,7 +207,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -263,20 +260,13 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, String scopeName, String privateEndpointConnectionName) { return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -285,15 +275,16 @@ private Mono getAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, scopeName, privateEndpointConnectionName).block(); + public Response getWithResponse( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).block(); } /** @@ -302,16 +293,15 @@ public PrivateEndpointConnectionInner get( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).block(); + public PrivateEndpointConnectionInner get( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, Context.NONE).getValue(); } /** @@ -324,7 +314,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -391,7 +381,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -455,9 +445,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return the {@link PollerFlux} for polling of a private endpoint connection. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -473,7 +463,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -487,9 +477,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return the {@link PollerFlux} for polling of a private endpoint connection. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -521,9 +511,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return the {@link SyncPoller} for polling of a private endpoint connection. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String scopeName, @@ -544,9 +534,9 @@ public SyncPoller, PrivateEndpointCon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return the {@link SyncPoller} for polling of a private endpoint connection. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String scopeName, @@ -568,7 +558,7 @@ public SyncPoller, PrivateEndpointCon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -592,7 +582,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -661,7 +651,7 @@ public PrivateEndpointConnectionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -718,7 +708,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -771,16 +761,17 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String scopeName, String privateEndpointConnectionName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -793,9 +784,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); @@ -815,9 +806,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String scopeName, String privateEndpointConnectionName) { return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName).getSyncPoller(); @@ -833,9 +824,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).getSyncPoller(); @@ -850,7 +841,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { @@ -869,7 +860,7 @@ private Mono deleteAsync(String resourceGroupName, String scopeName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -919,7 +910,8 @@ public void delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateLinkScopeSinglePageAsync( @@ -977,7 +969,8 @@ private Mono> listByPrivateLinkSco * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateLinkScopeSinglePageAsync( @@ -1031,7 +1024,7 @@ private Mono> listByPrivateLinkSco * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPrivateLinkScopeAsync( @@ -1050,7 +1043,7 @@ private PagedFlux listByPrivateLinkScopeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPrivateLinkScopeAsync( @@ -1068,7 +1061,8 @@ private PagedFlux listByPrivateLinkScopeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPrivateLinkScope( @@ -1085,7 +1079,8 @@ public PagedIterable listByPrivateLinkScope( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPrivateLinkScope( @@ -1096,11 +1091,13 @@ public PagedIterable listByPrivateLinkScope( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 a list of private endpoint connections. + * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateLinkScopeNextSinglePageAsync( @@ -1133,12 +1130,14 @@ private Mono> listByPrivateLinkSco /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 a list of private endpoint connections. + * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateLinkScopeNextSinglePageAsync( diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsImpl.java index 9e0b0cfa8d0d1..2ee5b85584e19 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateEndpointConnectionsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnection; import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnections; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); private final PrivateEndpointConnectionsClient innerClient; @@ -29,17 +28,6 @@ public PrivateEndpointConnectionsImpl( this.serviceManager = serviceManager; } - public PrivateEndpointConnection get( - String resourceGroupName, String scopeName, String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner = - this.serviceClient().get(resourceGroupName, scopeName, privateEndpointConnectionName); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { Response inner = @@ -55,6 +43,17 @@ public Response getWithResponse( } } + public PrivateEndpointConnection get( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, scopeName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { this.serviceClient().delete(resourceGroupName, scopeName, privateEndpointConnectionName); } @@ -80,7 +79,7 @@ public PagedIterable listByPrivateLinkScope( public PrivateEndpointConnection getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -88,7 +87,7 @@ public PrivateEndpointConnection getById(String id) { } String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); if (scopeName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -97,7 +96,7 @@ public PrivateEndpointConnection getById(String id) { } String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -113,7 +112,7 @@ public PrivateEndpointConnection getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -121,7 +120,7 @@ public Response getByIdWithResponse(String id, Contex } String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); if (scopeName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -130,7 +129,7 @@ public Response getByIdWithResponse(String id, Contex } String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -144,7 +143,7 @@ public Response getByIdWithResponse(String id, Contex public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -152,7 +151,7 @@ public void deleteById(String id) { } String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); if (scopeName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -161,7 +160,7 @@ public void deleteById(String id) { } String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -175,7 +174,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -183,7 +182,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); if (scopeName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -192,7 +191,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesClientImpl.java index b43cf8208a9c2..f85d9c4469903 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResourceListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PrivateLinkResourcesService service; @@ -110,7 +107,8 @@ Mono> listByPrivateLinkScopeNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateLinkScopeSinglePageAsync( @@ -168,7 +166,8 @@ private Mono> listByPrivateLinkScopeSing * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateLinkScopeSinglePageAsync( @@ -222,7 +221,8 @@ private Mono> listByPrivateLinkScopeSing * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPrivateLinkScopeAsync( @@ -241,7 +241,8 @@ private PagedFlux listByPrivateLinkScopeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPrivateLinkScopeAsync( @@ -259,7 +260,8 @@ private PagedFlux listByPrivateLinkScopeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName) { @@ -275,7 +277,8 @@ public PagedIterable listByPrivateLinkScope(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPrivateLinkScope( @@ -292,7 +295,8 @@ public PagedIterable listByPrivateLinkScope( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -346,7 +350,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -396,19 +401,13 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String scopeName, String groupName) { return getWithResponseAsync(resourceGroupName, scopeName, groupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -417,14 +416,17 @@ private Mono getAsync(String resourceGroupName, String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName) { - return getAsync(resourceGroupName, scopeName, groupName).block(); + public Response getWithResponse( + String resourceGroupName, String scopeName, String groupName, Context context) { + return getWithResponseAsync(resourceGroupName, scopeName, groupName, context).block(); } /** @@ -433,26 +435,26 @@ public PrivateLinkResourceInner get(String resourceGroupName, String scopeName, * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String scopeName, String groupName, Context context) { - return getWithResponseAsync(resourceGroupName, scopeName, groupName, context).block(); + public PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName) { + return getWithResponse(resourceGroupName, scopeName, groupName, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 a list of private link resources. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateLinkScopeNextSinglePageAsync(String nextLink) { @@ -484,12 +486,14 @@ private Mono> listByPrivateLinkScopeNext /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 a list of private link resources. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateLinkScopeNextSinglePageAsync( diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesImpl.java index fba73f7b44a72..0df9328ec07e5 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkResourcesImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResource; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResources; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PrivateLinkResourcesImpl implements PrivateLinkResources { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); private final PrivateLinkResourcesClient innerClient; @@ -42,15 +41,6 @@ public PagedIterable listByPrivateLinkScope( return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PrivateLinkResource get(String resourceGroupName, String scopeName, String groupName) { - PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, scopeName, groupName); - if (inner != null) { - return new PrivateLinkResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String scopeName, String groupName, Context context) { Response inner = @@ -66,6 +56,15 @@ public Response getWithResponse( } } + public PrivateLinkResource get(String resourceGroupName, String scopeName, String groupName) { + PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, scopeName, groupName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + private PrivateLinkResourcesClient serviceClient() { return this.innerClient; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesClientImpl.java index 1efa5ca82854a..a85d458feb918 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesClientImpl.java @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridcompute.fluent.PrivateLinkScopesClient; @@ -44,8 +43,6 @@ /** An instance of this class provides access to all the operations defined in PrivateLinkScopesClient. */ public final class PrivateLinkScopesClientImpl implements PrivateLinkScopesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkScopesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PrivateLinkScopesService service; @@ -213,7 +210,8 @@ Mono> listByResourceGroupNext( * * @throws 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 all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -259,7 +257,8 @@ private Mono> listSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -300,7 +299,8 @@ private Mono> listSinglePageAs * * @throws 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 all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -314,7 +314,8 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -327,7 +328,8 @@ private PagedFlux listAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -341,7 +343,8 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -355,7 +358,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -408,7 +412,8 @@ private Mono> listByResourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -457,7 +462,8 @@ private Mono> listByResourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -474,7 +480,8 @@ private PagedFlux listByResourceGroupAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( @@ -491,7 +498,8 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -506,7 +514,8 @@ public PagedIterable listByResourceGroup(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( @@ -522,7 +531,7 @@ public PagedIterable listByResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String scopeName) { @@ -570,7 +579,7 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -615,14 +624,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String scopeName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -634,9 +644,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String scopeName, Context context) { context = this.client.mergeContext(context); @@ -654,9 +664,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName) { return beginDeleteAsync(resourceGroupName, scopeName).getSyncPoller(); } @@ -670,9 +680,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, Context context) { return beginDeleteAsync(resourceGroupName, scopeName, context).getSyncPoller(); } @@ -685,7 +695,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String scopeName) { @@ -701,7 +711,7 @@ private Mono deleteAsync(String resourceGroupName, String scopeName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String scopeName, Context context) { @@ -747,7 +757,8 @@ public void delete(String resourceGroupName, String scopeName, Context context) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -796,7 +807,8 @@ private Mono> getByResourceGroupWit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -841,20 +853,13 @@ private Mono> getByResourceGroupWit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync( String resourceGroupName, String scopeName) { return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -862,14 +867,16 @@ private Mono getByResourceGroupAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope 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 an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public HybridComputePrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName) { - return getByResourceGroupAsync(resourceGroupName, scopeName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String scopeName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName, context).block(); } /** @@ -877,16 +884,14 @@ public HybridComputePrivateLinkScopeInner getByResourceGroup(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope 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 an Azure Arc PrivateLinkScope definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String scopeName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName, context).block(); + public HybridComputePrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName) { + return getByResourceGroupWithResponse(resourceGroupName, scopeName, Context.NONE).getValue(); } /** @@ -900,7 +905,8 @@ public Response getByResourceGroupWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -958,7 +964,8 @@ private Mono> createOrUpdateWithRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -1012,20 +1019,13 @@ private Mono> createOrUpdateWithRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( String resourceGroupName, String scopeName, HybridComputePrivateLinkScopeInner parameters) { return createOrUpdateWithResponseAsync(resourceGroupName, scopeName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1036,15 +1036,16 @@ private Mono createOrUpdateAsync( * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters * PrivateLinkScope. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public HybridComputePrivateLinkScopeInner createOrUpdate( - String resourceGroupName, String scopeName, HybridComputePrivateLinkScopeInner parameters) { - return createOrUpdateAsync(resourceGroupName, scopeName, parameters).block(); + public Response createOrUpdateWithResponse( + String resourceGroupName, String scopeName, HybridComputePrivateLinkScopeInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, scopeName, parameters, context).block(); } /** @@ -1055,16 +1056,15 @@ public HybridComputePrivateLinkScopeInner createOrUpdate( * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters * PrivateLinkScope. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Arc PrivateLinkScope definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String scopeName, HybridComputePrivateLinkScopeInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, scopeName, parameters, context).block(); + public HybridComputePrivateLinkScopeInner createOrUpdate( + String resourceGroupName, String scopeName, HybridComputePrivateLinkScopeInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, scopeName, parameters, Context.NONE).getValue(); } /** @@ -1076,7 +1076,8 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateTagsWithResponseAsync( @@ -1133,7 +1134,8 @@ private Mono> updateTagsWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateTagsWithResponseAsync( @@ -1186,20 +1188,13 @@ private Mono> updateTagsWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateTagsAsync( String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags) { return updateTagsWithResponseAsync(resourceGroupName, scopeName, privateLinkScopeTags) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1208,15 +1203,16 @@ private Mono updateTagsAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public HybridComputePrivateLinkScopeInner updateTags( - String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags) { - return updateTagsAsync(resourceGroupName, scopeName, privateLinkScopeTags).block(); + public Response updateTagsWithResponse( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, scopeName, privateLinkScopeTags, context).block(); } /** @@ -1225,16 +1221,15 @@ public HybridComputePrivateLinkScopeInner updateTags( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Arc PrivateLinkScope definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTagsWithResponse( - String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags, Context context) { - return updateTagsWithResponseAsync(resourceGroupName, scopeName, privateLinkScopeTags, context).block(); + public HybridComputePrivateLinkScopeInner updateTags( + String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags) { + return updateTagsWithResponse(resourceGroupName, scopeName, privateLinkScopeTags, Context.NONE).getValue(); } /** @@ -1245,7 +1240,7 @@ public Response updateTagsWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getValidationDetailsWithResponseAsync( @@ -1294,7 +1289,7 @@ private Mono> getValidationDeta * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getValidationDetailsWithResponseAsync( @@ -1339,20 +1334,13 @@ private Mono> getValidationDeta * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getValidationDetailsAsync( String location, String privateLinkScopeId) { return getValidationDetailsWithResponseAsync(location, privateLinkScopeId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1360,14 +1348,16 @@ private Mono getValidationDetailsAsync( * * @param location The location of the target resource. * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope 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 response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkScopeValidationDetailsInner getValidationDetails(String location, String privateLinkScopeId) { - return getValidationDetailsAsync(location, privateLinkScopeId).block(); + public Response getValidationDetailsWithResponse( + String location, String privateLinkScopeId, Context context) { + return getValidationDetailsWithResponseAsync(location, privateLinkScopeId, context).block(); } /** @@ -1375,16 +1365,14 @@ public PrivateLinkScopeValidationDetailsInner getValidationDetails(String locati * * @param location The location of the target resource. * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope 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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getValidationDetailsWithResponse( - String location, String privateLinkScopeId, Context context) { - return getValidationDetailsWithResponseAsync(location, privateLinkScopeId, context).block(); + public PrivateLinkScopeValidationDetailsInner getValidationDetails(String location, String privateLinkScopeId) { + return getValidationDetailsWithResponse(location, privateLinkScopeId, Context.NONE).getValue(); } /** @@ -1395,7 +1383,7 @@ public Response getValidationDetailsWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getValidationDetailsForMachineWithResponseAsync( @@ -1444,7 +1432,7 @@ private Mono> getValidationDeta * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getValidationDetailsForMachineWithResponseAsync( @@ -1489,20 +1477,13 @@ private Mono> getValidationDeta * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getValidationDetailsForMachineAsync( String resourceGroupName, String machineName) { return getValidationDetailsForMachineWithResponseAsync(resourceGroupName, machineName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1510,15 +1491,16 @@ private Mono getValidationDetailsForMach * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the target machine to get the private link scope validation details for. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkScopeValidationDetailsInner getValidationDetailsForMachine( - String resourceGroupName, String machineName) { - return getValidationDetailsForMachineAsync(resourceGroupName, machineName).block(); + public Response getValidationDetailsForMachineWithResponse( + String resourceGroupName, String machineName, Context context) { + return getValidationDetailsForMachineWithResponseAsync(resourceGroupName, machineName, context).block(); } /** @@ -1526,26 +1508,27 @@ public PrivateLinkScopeValidationDetailsInner getValidationDetailsForMachine( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the target machine to get the private link scope validation details for. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getValidationDetailsForMachineWithResponse( - String resourceGroupName, String machineName, Context context) { - return getValidationDetailsForMachineWithResponseAsync(resourceGroupName, machineName, context).block(); + public PrivateLinkScopeValidationDetailsInner getValidationDetailsForMachine( + String resourceGroupName, String machineName) { + return getValidationDetailsForMachineWithResponse(resourceGroupName, machineName, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 describes the list of Azure Arc PrivateLinkScope resources. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1576,12 +1559,14 @@ private Mono> listNextSinglePa /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 describes the list of Azure Arc PrivateLinkScope resources. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( @@ -1613,11 +1598,13 @@ private Mono> listNextSinglePa /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 describes the list of Azure Arc PrivateLinkScope resources. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( @@ -1650,12 +1637,14 @@ private Mono> listByResourceGr /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 describes the list of Azure Arc PrivateLinkScope resources. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesImpl.java index b667936f39825..edbfe6dcaf874 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/PrivateLinkScopesImpl.java @@ -15,10 +15,9 @@ import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopeValidationDetails; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopes; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PrivateLinkScopesImpl implements PrivateLinkScopes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkScopesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkScopesImpl.class); private final PrivateLinkScopesClient innerClient; @@ -61,16 +60,6 @@ public void delete(String resourceGroupName, String scopeName, Context context) this.serviceClient().delete(resourceGroupName, scopeName, context); } - public HybridComputePrivateLinkScope getByResourceGroup(String resourceGroupName, String scopeName) { - HybridComputePrivateLinkScopeInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, scopeName); - if (inner != null) { - return new HybridComputePrivateLinkScopeImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String scopeName, Context context) { Response inner = @@ -86,11 +75,11 @@ public Response getByResourceGroupWithResponse( } } - public PrivateLinkScopeValidationDetails getValidationDetails(String location, String privateLinkScopeId) { - PrivateLinkScopeValidationDetailsInner inner = - this.serviceClient().getValidationDetails(location, privateLinkScopeId); + public HybridComputePrivateLinkScope getByResourceGroup(String resourceGroupName, String scopeName) { + HybridComputePrivateLinkScopeInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, scopeName); if (inner != null) { - return new PrivateLinkScopeValidationDetailsImpl(inner, this.manager()); + return new HybridComputePrivateLinkScopeImpl(inner, this.manager()); } else { return null; } @@ -111,10 +100,9 @@ public Response getValidationDetailsWithRespo } } - public PrivateLinkScopeValidationDetails getValidationDetailsForMachine( - String resourceGroupName, String machineName) { + public PrivateLinkScopeValidationDetails getValidationDetails(String location, String privateLinkScopeId) { PrivateLinkScopeValidationDetailsInner inner = - this.serviceClient().getValidationDetailsForMachine(resourceGroupName, machineName); + this.serviceClient().getValidationDetails(location, privateLinkScopeId); if (inner != null) { return new PrivateLinkScopeValidationDetailsImpl(inner, this.manager()); } else { @@ -137,10 +125,21 @@ public Response getValidationDetailsForMachin } } + public PrivateLinkScopeValidationDetails getValidationDetailsForMachine( + String resourceGroupName, String machineName) { + PrivateLinkScopeValidationDetailsInner inner = + this.serviceClient().getValidationDetailsForMachine(resourceGroupName, machineName); + if (inner != null) { + return new PrivateLinkScopeValidationDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + public HybridComputePrivateLinkScope getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -148,7 +147,7 @@ public HybridComputePrivateLinkScope getById(String id) { } String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); if (scopeName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -161,7 +160,7 @@ public HybridComputePrivateLinkScope getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -169,7 +168,7 @@ public Response getByIdWithResponse(String id, Co } String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); if (scopeName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -182,7 +181,7 @@ public Response getByIdWithResponse(String id, Co public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -190,7 +189,7 @@ public void deleteById(String id) { } String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); if (scopeName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -203,7 +202,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -211,7 +210,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String scopeName = Utils.getValueFromIdByName(id, "privateLinkScopes"); if (scopeName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..78304e68f46f5 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +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 ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientResourceProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" + + "/machines/{machineName}/upgradeExtensions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgradeExtensions( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @BodyParam("application/json") MachineExtensionUpgrade extensionUpgradeParameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> upgradeExtensionsWithResponseAsync( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + 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 (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .upgradeExtensions( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + extensionUpgradeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> upgradeExtensionsWithResponseAsync( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + 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 (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .upgradeExtensions( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + extensionUpgradeParameters, + accept, + context); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeExtensionsAsync( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + Mono>> mono = + upgradeExtensionsWithResponseAsync(resourceGroupName, machineName, extensionUpgradeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeExtensionsAsync( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + upgradeExtensionsWithResponseAsync(resourceGroupName, machineName, extensionUpgradeParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + return beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters).getSyncPoller(); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + return beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters, context) + .getSyncPoller(); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 upgradeExtensionsAsync( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + return beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 upgradeExtensionsAsync( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + return beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + upgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters).block(); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + upgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters, context).block(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..cea28dc9778fd --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import com.azure.resourcemanager.hybridcompute.models.ResourceProviders; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + this.serviceClient().upgradeExtensions(resourceGroupName, machineName, extensionUpgradeParameters); + } + + public void upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + this.serviceClient().upgradeExtensions(resourceGroupName, machineName, extensionUpgradeParameters, context); + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java new file mode 100644 index 0000000000000..ac3b543a3ed29 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.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.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. */ +@Immutable +public final class AgentConfiguration { + /* + * Specifies the URL of the proxy to be used. + */ + @JsonProperty(value = "proxyUrl", access = JsonProperty.Access.WRITE_ONLY) + private String proxyUrl; + + /* + * Specifies the list of ports that the agent will be able to listen on. + */ + @JsonProperty(value = "incomingConnectionsPorts", access = JsonProperty.Access.WRITE_ONLY) + private List incomingConnectionsPorts; + + /* + * Array of extensions that are allowed to be installed or updated. + */ + @JsonProperty(value = "extensionsAllowList", access = JsonProperty.Access.WRITE_ONLY) + private List extensionsAllowList; + + /* + * Array of extensions that are blocked (cannot be installed or updated) + */ + @JsonProperty(value = "extensionsBlockList", access = JsonProperty.Access.WRITE_ONLY) + private List extensionsBlockList; + + /* + * List of service names which should not use the specified proxy server. + */ + @JsonProperty(value = "proxyBypass", access = JsonProperty.Access.WRITE_ONLY) + private List proxyBypass; + + /* + * Specifies whether the extension service is enabled or disabled. + */ + @JsonProperty(value = "extensionsEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String extensionsEnabled; + + /* + * Specified whether the guest configuration service is enabled or disabled. + */ + @JsonProperty(value = "guestConfigurationEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String guestConfigurationEnabled; + + /* + * Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension + * allowlists and guest configuration, maintained by Microsoft. + */ + @JsonProperty(value = "configMode", access = JsonProperty.Access.WRITE_ONLY) + private AgentConfigurationMode configMode; + + /** Creates an instance of AgentConfiguration class. */ + public AgentConfiguration() { + } + + /** + * Get the proxyUrl property: Specifies the URL of the proxy to be used. + * + * @return the proxyUrl value. + */ + public String proxyUrl() { + return this.proxyUrl; + } + + /** + * Get the incomingConnectionsPorts property: Specifies the list of ports that the agent will be able to listen on. + * + * @return the incomingConnectionsPorts value. + */ + public List incomingConnectionsPorts() { + return this.incomingConnectionsPorts; + } + + /** + * Get the extensionsAllowList property: Array of extensions that are allowed to be installed or updated. + * + * @return the extensionsAllowList value. + */ + public List extensionsAllowList() { + return this.extensionsAllowList; + } + + /** + * Get the extensionsBlockList property: Array of extensions that are blocked (cannot be installed or updated). + * + * @return the extensionsBlockList value. + */ + public List extensionsBlockList() { + return this.extensionsBlockList; + } + + /** + * Get the proxyBypass property: List of service names which should not use the specified proxy server. + * + * @return the proxyBypass value. + */ + public List proxyBypass() { + return this.proxyBypass; + } + + /** + * Get the extensionsEnabled property: Specifies whether the extension service is enabled or disabled. + * + * @return the extensionsEnabled value. + */ + public String extensionsEnabled() { + return this.extensionsEnabled; + } + + /** + * Get the guestConfigurationEnabled property: Specified whether the guest configuration service is enabled or + * disabled. + * + * @return the guestConfigurationEnabled value. + */ + public String guestConfigurationEnabled() { + return this.guestConfigurationEnabled; + } + + /** + * Get the configMode property: Name of configuration mode to use. Modes are pre-defined configurations of security + * controls, extension allowlists and guest configuration, maintained by Microsoft. + * + * @return the configMode value. + */ + public AgentConfigurationMode configMode() { + return this.configMode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionsAllowList() != null) { + extensionsAllowList().forEach(e -> e.validate()); + } + if (extensionsBlockList() != null) { + extensionsBlockList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java new file mode 100644 index 0000000000000..958186bb7fced --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension allowlists + * and guest configuration, maintained by Microsoft. + */ +public final class AgentConfigurationMode extends ExpandableStringEnum { + /** Static value full for AgentConfigurationMode. */ + public static final AgentConfigurationMode FULL = fromString("full"); + + /** Static value monitor for AgentConfigurationMode. */ + public static final AgentConfigurationMode MONITOR = fromString("monitor"); + + /** + * Creates or finds a AgentConfigurationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentConfigurationMode. + */ + @JsonCreator + public static AgentConfigurationMode fromString(String name) { + return fromString(name, AgentConfigurationMode.class); + } + + /** + * Gets known AgentConfigurationMode values. + * + * @return known AgentConfigurationMode values. + */ + public static Collection values() { + return values(AgentConfigurationMode.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java new file mode 100644 index 0000000000000..6cda2cc395bd6 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the assessment mode. */ +public final class AssessmentModeTypes extends ExpandableStringEnum { + /** Static value ImageDefault for AssessmentModeTypes. */ + public static final AssessmentModeTypes IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for AssessmentModeTypes. */ + public static final AssessmentModeTypes AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates or finds a AssessmentModeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssessmentModeTypes. + */ + @JsonCreator + public static AssessmentModeTypes fromString(String name) { + return fromString(name, AssessmentModeTypes.class); + } + + /** + * Gets known AssessmentModeTypes values. + * + * @return known AssessmentModeTypes values. + */ + public static Collection values() { + return values(AssessmentModeTypes.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java new file mode 100644 index 0000000000000..ac65d2743e4fa --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The metadata of the cloud environment (Azure/GCP/AWS/OCI...). */ +@Immutable +public final class CloudMetadata { + /* + * Specifies the cloud provider (Azure/AWS/GCP...). + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** Creates an instance of CloudMetadata class. */ + public CloudMetadata() { + } + + /** + * Get the provider property: Specifies the cloud provider (Azure/AWS/GCP...). + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java new file mode 100644 index 0000000000000..096d36407fd92 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.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.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes properties that can identify extensions. */ +@Immutable +public final class ConfigurationExtension { + /* + * Publisher of the extension. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /* + * Type of the extension. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** Creates an instance of ConfigurationExtension class. */ + public ConfigurationExtension() { + } + + /** + * Get the publisher property: Publisher of the extension. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Get the type property: Type of the extension. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConnectionDetail.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConnectionDetail.java index f938b44726692..55b3c5b65923c 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConnectionDetail.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConnectionDetail.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The ConnectionDetail model. */ @Immutable public final class ConnectionDetail { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionDetail.class); - /* * Azure resource Id */ @@ -44,6 +40,10 @@ public final class ConnectionDetail { @JsonProperty(value = "memberName", access = JsonProperty.Access.WRITE_ONLY) private String memberName; + /** Creates an instance of ConnectionDetail class. */ + public ConnectionDetail() { + } + /** * Get the id property: Azure resource Id. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java new file mode 100644 index 0000000000000..9c2700b105289 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.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.hybridcompute.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 ExtensionMetadatas. */ +public interface ExtensionMetadatas { + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version along with {@link + * Response}. + */ + Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context); + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Metadata based on location, publisher, extensionType and version. + */ + ExtensionValue get(String location, String publisher, String extensionType, String version); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String location, String publisher, String extensionType); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String location, String publisher, String extensionType, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.java new file mode 100644 index 0000000000000..a7c0c522490ec --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.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.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the Machine Extension Target Version Properties. */ +@Fluent +public final class ExtensionTargetProperties { + /* + * Properties for the specified Extension to Upgrade. + */ + @JsonProperty(value = "targetVersion") + private String targetVersion; + + /** Creates an instance of ExtensionTargetProperties class. */ + public ExtensionTargetProperties() { + } + + /** + * Get the targetVersion property: Properties for the specified Extension to Upgrade. + * + * @return the targetVersion value. + */ + public String targetVersion() { + return this.targetVersion; + } + + /** + * Set the targetVersion property: Properties for the specified Extension to Upgrade. + * + * @param targetVersion the targetVersion value to set. + * @return the ExtensionTargetProperties object itself. + */ + public ExtensionTargetProperties withTargetVersion(String targetVersion) { + this.targetVersion = targetVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java new file mode 100644 index 0000000000000..1538a450b3c18 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; + +/** An immutable client-side representation of ExtensionValue. */ +public interface ExtensionValue { + /** + * 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 version property: The version of the Extension being received. + * + * @return the version value. + */ + String version(); + + /** + * Gets the extensionType property: The type of the Extension being received. + * + * @return the extensionType value. + */ + String extensionType(); + + /** + * Gets the publisher property: The publisher of the Extension being received. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner object. + * + * @return the inner object. + */ + ExtensionValueInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.java new file mode 100644 index 0000000000000..c773218ee9aae --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.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.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Extension Metadata response. */ +@Immutable +public final class ExtensionValueListResult { + /* + * The list of extension metadata + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of ExtensionValueListResult class. */ + public ExtensionValueListResult() { + } + + /** + * Get the value property: The list of extension metadata. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * 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/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScope.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScope.java index ac577c6039edc..6c2e87e2e314a 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScope.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScope.java @@ -75,6 +75,13 @@ public interface HybridComputePrivateLinkScope { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.HybridComputePrivateLinkScopeInner object. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeListResult.java index 251fa6c813e23..b17ac74d92c44 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeListResult.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeListResult.java @@ -7,15 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.models.HybridComputePrivateLinkScopeInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Describes the list of Azure Arc PrivateLinkScope resources. */ @Fluent public final class HybridComputePrivateLinkScopeListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridComputePrivateLinkScopeListResult.class); - /* * List of Azure Arc PrivateLinkScope definitions. */ @@ -23,12 +20,16 @@ public final class HybridComputePrivateLinkScopeListResult { private List value; /* - * The URI to get the next set of Azure Arc PrivateLinkScope definitions if - * too many PrivateLinkScopes where returned in the result set. + * The URI to get the next set of Azure Arc PrivateLinkScope definitions if too many PrivateLinkScopes where + * returned in the result set. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of HybridComputePrivateLinkScopeListResult class. */ + public HybridComputePrivateLinkScopeListResult() { + } + /** * Get the value property: List of Azure Arc PrivateLinkScope definitions. * @@ -78,7 +79,7 @@ public HybridComputePrivateLinkScopeListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property value in model HybridComputePrivateLinkScopeListResult")); @@ -86,4 +87,6 @@ public void validate() { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(HybridComputePrivateLinkScopeListResult.class); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java index 24dc7ae03bdc5..c21577f80bc21 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java @@ -5,27 +5,23 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Properties that define a Azure Arc PrivateLinkScope resource. */ @Fluent public final class HybridComputePrivateLinkScopeProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridComputePrivateLinkScopeProperties.class); - /* - * Indicates whether machines associated with the private link scope can - * also use public Azure Arc service endpoints. + * Indicates whether machines associated with the private link scope can also use public Azure Arc service + * endpoints. */ @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccessType publicNetworkAccess; /* - * Current state of this PrivateLinkScope: whether or not is has been - * provisioned within the resource group it is defined. Users cannot change - * this value but are able to read from it. Values will include - * Provisioning ,Succeeded, Canceled and Failed. + * Current state of this PrivateLinkScope: whether or not is has been provisioned within the resource group it is + * defined. Users cannot change this value but are able to read from it. Values will include Provisioning + * ,Succeeded, Canceled and Failed. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; @@ -36,6 +32,16 @@ public final class HybridComputePrivateLinkScopeProperties { @JsonProperty(value = "privateLinkScopeId", access = JsonProperty.Access.WRITE_ONLY) private String privateLinkScopeId; + /* + * The collection of associated Private Endpoint Connections. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** Creates an instance of HybridComputePrivateLinkScopeProperties class. */ + public HybridComputePrivateLinkScopeProperties() { + } + /** * Get the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also * use public Azure Arc service endpoints. @@ -79,11 +85,23 @@ public String privateLinkScopeId() { return this.privateLinkScopeId; } + /** + * Get the privateEndpointConnections property: The collection of associated Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Identity.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Identity.java index 2d160657d512f..cbf5967acc67c 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Identity.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Identity.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Identity for the resource. */ @Fluent public class Identity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); - /* * The principal ID of resource identity. */ @@ -32,6 +28,10 @@ public class Identity { @JsonProperty(value = "type") private ResourceIdentityType type; + /** Creates an instance of Identity class. */ + public Identity() { + } + /** * Get the principalId property: The principal ID of resource identity. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/InstanceViewTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/InstanceViewTypes.java index bd5a2020e37b5..c1797af286452 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/InstanceViewTypes.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/InstanceViewTypes.java @@ -24,7 +24,11 @@ public static InstanceViewTypes fromString(String name) { return fromString(name, InstanceViewTypes.class); } - /** @return known InstanceViewTypes values. */ + /** + * Gets known InstanceViewTypes values. + * + * @return known InstanceViewTypes values. + */ public static Collection values() { return values(InstanceViewTypes.class); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LocationData.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LocationData.java index 85af50954bd03..f381b2483f5fe 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LocationData.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LocationData.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Metadata pertaining to the geographic location of the resource. */ @Fluent public final class LocationData { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationData.class); - /* * A canonical name for the geographic or physical location. */ @@ -38,6 +35,10 @@ public final class LocationData { @JsonProperty(value = "countryOrRegion") private String countryOrRegion; + /** Creates an instance of LocationData class. */ + public LocationData() { + } + /** * Get the name property: A canonical name for the geographic or physical location. * @@ -125,9 +126,11 @@ public LocationData withCountryOrRegion(String countryOrRegion) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model LocationData")); } } + + private static final ClientLogger LOGGER = new ClientLogger(LocationData.class); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java index 4d18ab209beb8..020ea88a67d7c 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of Machine. */ @@ -46,11 +49,11 @@ public interface Machine { Map tags(); /** - * Gets the properties property: Hybrid Compute Machine properties. + * Gets the resources property: The list of extensions affiliated to the machine. * - * @return the properties value. + * @return the resources value. */ - MachineProperties properties(); + List resources(); /** * Gets the identity property: Identity for the resource. @@ -60,12 +63,198 @@ public interface Machine { Identity identity(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. + */ + LocationData locationData(); + + /** + * Gets the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. + */ + AgentConfiguration agentConfiguration(); + + /** + * Gets the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. + */ + ServiceStatuses serviceStatuses(); + + /** + * Gets the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + CloudMetadata cloudMetadata(); + + /** + * Gets the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + OSProfile osProfile(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the status property: The status of the hybrid machine agent. + * + * @return the status value. + */ + StatusTypes status(); + + /** + * Gets the lastStatusChange property: The time of the last status change. + * + * @return the lastStatusChange value. + */ + OffsetDateTime lastStatusChange(); + + /** + * Gets the errorDetails property: Details about the error state. + * + * @return the errorDetails value. + */ + List errorDetails(); + + /** + * Gets the agentVersion property: The hybrid machine agent full version. + * + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * Gets the vmId property: Specifies the hybrid machine unique ID. + * + * @return the vmId value. + */ + String vmId(); + + /** + * Gets the displayName property: Specifies the hybrid machine display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the machineFqdn property: Specifies the hybrid machine FQDN. + * + * @return the machineFqdn value. + */ + String machineFqdn(); + + /** + * Gets the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @return the clientPublicKey value. + */ + String clientPublicKey(); + + /** + * Gets the osName property: The Operating System running on the hybrid machine. + * + * @return the osName value. + */ + String osName(); + + /** + * Gets the osVersion property: The version of Operating System running on the hybrid machine. + * + * @return the osVersion value. + */ + String osVersion(); + + /** + * Gets the osType property: The type of Operating System (windows/linux). + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. + * + * @return the vmUuid value. + */ + String vmUuid(); + + /** + * Gets the osSku property: Specifies the Operating System product SKU. + * + * @return the osSku value. + */ + String osSku(); + + /** + * Gets the domainName property: Specifies the Windows domain name. + * + * @return the domainName value. + */ + String domainName(); + + /** + * Gets the adFqdn property: Specifies the AD fully qualified display name. + * + * @return the adFqdn value. + */ + String adFqdn(); + + /** + * Gets the dnsFqdn property: Specifies the DNS fully qualified display name. + * + * @return the dnsFqdn value. + */ + String dnsFqdn(); + + /** + * Gets the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + String privateLinkScopeResourceId(); + + /** + * Gets the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + String parentClusterResourceId(); + + /** + * Gets the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @return the mssqlDiscovered value. + */ + String mssqlDiscovered(); + + /** + * Gets the detectedProperties property: Detected properties from the machine. + * + * @return the detectedProperties value. + */ + Map detectedProperties(); + /** * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner object. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java index 7dacfd381cf89..e4ae52de3ecce 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java @@ -48,18 +48,86 @@ public interface MachineExtension { Map tags(); /** - * Gets the properties property: Describes Machine Extension Properties. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the properties value. + * @return the systemData value. */ - MachineExtensionProperties properties(); + SystemData systemData(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. * - * @return the systemData value. + * @return the forceUpdateTag value. */ - SystemData systemData(); + String forceUpdateTag(); + + /** + * Gets the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * Gets the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + + /** + * Gets the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if + * one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * Gets the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + Map settings(); + + /** + * Gets the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + Map protectedSettings(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The machine extension instance view. + * + * @return the instanceView value. + */ + MachineExtensionInstanceView instanceView(); /** * Gets the region of the resource. @@ -75,6 +143,13 @@ public interface MachineExtension { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner object. * @@ -127,7 +202,17 @@ interface WithParentResource { * The stage of the MachineExtension 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.WithProperties { + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithForceUpdateTag, + DefinitionStages.WithPublisher, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTypeHandlerVersion, + DefinitionStages.WithEnableAutomaticUpgrade, + DefinitionStages.WithAutoUpgradeMinorVersion, + DefinitionStages.WithSettings, + DefinitionStages.WithProtectedSettings, + DefinitionStages.WithInstanceView { /** * Executes the create request. * @@ -153,15 +238,106 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the MachineExtension definition allowing to specify properties. */ - interface WithProperties { + /** The stage of the MachineExtension definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the MachineExtension definition allowing to specify publisher. */ + interface WithPublisher { /** - * Specifies the properties property: Describes Machine Extension Properties.. + * Specifies the publisher property: The name of the extension handler publisher.. * - * @param properties Describes Machine Extension Properties. + * @param publisher The name of the extension handler publisher. * @return the next definition stage. */ - WithCreate withProperties(MachineExtensionProperties properties); + WithCreate withPublisher(String publisher); + } + /** The stage of the MachineExtension definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + /** The stage of the MachineExtension definition allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the MachineExtension definition allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * @return the next definition stage. + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the MachineExtension definition allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the MachineExtension definition allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + WithCreate withSettings(Map settings); + } + /** The stage of the MachineExtension definition allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. + * + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * @return the next definition stage. + */ + WithCreate withProtectedSettings(Map protectedSettings); + } + /** The stage of the MachineExtension definition allowing to specify instanceView. */ + interface WithInstanceView { + /** + * Specifies the instanceView property: The machine extension instance view.. + * + * @param instanceView The machine extension instance view. + * @return the next definition stage. + */ + WithCreate withInstanceView(MachineExtensionInstanceView instanceView); } } /** @@ -172,7 +348,16 @@ interface WithProperties { MachineExtension.Update update(); /** The template for MachineExtension update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithForceUpdateTag, + UpdateStages.WithPublisher, + UpdateStages.WithType, + UpdateStages.WithTypeHandlerVersion, + UpdateStages.WithEnableAutomaticUpgrade, + UpdateStages.WithAutoUpgradeMinorVersion, + UpdateStages.WithSettings, + UpdateStages.WithProtectedSettings { /** * Executes the update request. * @@ -200,15 +385,95 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the MachineExtension update allowing to specify properties. */ - interface WithProperties { + /** The stage of the MachineExtension update allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + Update withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the MachineExtension update allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + /** The stage of the MachineExtension update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Specifies the type of the extension; an example is "CustomScriptExtension".. + * + * @param type Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the MachineExtension update allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the MachineExtension update allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * @return the next definition stage. + */ + Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the MachineExtension update allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the MachineExtension update allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + Update withSettings(Map settings); + } + /** The stage of the MachineExtension update allowing to specify protectedSettings. */ + interface WithProtectedSettings { /** - * Specifies the properties property: Describes Machine Extension Update Properties.. + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. * - * @param properties Describes Machine Extension Update Properties. + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. * @return the next definition stage. */ - Update withProperties(MachineExtensionUpdateProperties properties); + Update withProtectedSettings(Map protectedSettings); } } /** diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionInstanceView.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionInstanceView.java index efac6a08702d7..9e7df08f67dc6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionInstanceView.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionInstanceView.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the Machine Extension Instance View. */ @Fluent public final class MachineExtensionInstanceView { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineExtensionInstanceView.class); - /* * The machine extension name. */ @@ -21,8 +17,7 @@ public final class MachineExtensionInstanceView { private String name; /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Specifies the type of the extension; an example is "CustomScriptExtension". */ @JsonProperty(value = "type") private String type; @@ -39,6 +34,10 @@ public final class MachineExtensionInstanceView { @JsonProperty(value = "status") private MachineExtensionInstanceViewStatus status; + /** Creates an instance of MachineExtensionInstanceView class. */ + public MachineExtensionInstanceView() { + } + /** * Get the name property: The machine extension name. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionInstanceViewStatus.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionInstanceViewStatus.java index 47aff058cdf4b..ea4080955348a 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionInstanceViewStatus.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionInstanceViewStatus.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Instance view status. */ @Fluent public final class MachineExtensionInstanceViewStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineExtensionInstanceViewStatus.class); - /* * The status code. */ @@ -45,6 +41,10 @@ public final class MachineExtensionInstanceViewStatus { @JsonProperty(value = "time") private OffsetDateTime time; + /** Creates an instance of MachineExtensionInstanceViewStatus class. */ + public MachineExtensionInstanceViewStatus() { + } + /** * Get the code property: The status code. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java index daf7580dbd389..3931bb1c5bfba 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java @@ -5,46 +5,230 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionUpdateProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Describes a Machine Extension Update. */ @Fluent public final class MachineExtensionUpdate extends ResourceUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineExtensionUpdate.class); - /* * Describes Machine Extension Update Properties. */ @JsonProperty(value = "properties") - private MachineExtensionUpdateProperties properties; + private MachineExtensionUpdateProperties innerProperties; + + /** Creates an instance of MachineExtensionUpdate class. */ + public MachineExtensionUpdate() { + } /** - * Get the properties property: Describes Machine Extension Update Properties. + * Get the innerProperties property: Describes Machine Extension Update Properties. * - * @return the properties value. + * @return the innerProperties value. */ - public MachineExtensionUpdateProperties properties() { - return this.properties; + private MachineExtensionUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MachineExtensionUpdate withTags(Map tags) { + super.withTags(tags); + return this; } /** - * Set the properties property: Describes Machine Extension Update Properties. + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. * - * @param properties the properties value to set. + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. * @return the MachineExtensionUpdate object itself. */ - public MachineExtensionUpdate withProperties(MachineExtensionUpdateProperties properties) { - this.properties = properties; + public MachineExtensionUpdate withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); return this; } - /** {@inheritDoc} */ - @Override - public MachineExtensionUpdate withTags(Map tags) { - super.withTags(tags); + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Map settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withSettings(Map settings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Map protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withProtectedSettings(Map protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); return this; } @@ -56,8 +240,8 @@ public MachineExtensionUpdate withTags(Map tags) { @Override public void validate() { super.validate(); - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java new file mode 100644 index 0000000000000..e6948cd70ddcc --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes the Machine Extension Upgrade Properties. */ +@Fluent +public final class MachineExtensionUpgrade { + /* + * Describes the Extension Target Properties. + */ + @JsonProperty(value = "extensionTargets") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extensionTargets; + + /** Creates an instance of MachineExtensionUpgrade class. */ + public MachineExtensionUpgrade() { + } + + /** + * Get the extensionTargets property: Describes the Extension Target Properties. + * + * @return the extensionTargets value. + */ + public Map extensionTargets() { + return this.extensionTargets; + } + + /** + * Set the extensionTargets property: Describes the Extension Target Properties. + * + * @param extensionTargets the extensionTargets value to set. + * @return the MachineExtensionUpgrade object itself. + */ + public MachineExtensionUpgrade withExtensionTargets(Map extensionTargets) { + this.extensionTargets = extensionTargets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionTargets() != null) { + extensionTargets() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensions.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensions.java index 0bafcc24c2af1..255714cd384b2 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensions.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensions.java @@ -41,12 +41,14 @@ public interface MachineExtensions { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the machine containing the extension. * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response}. */ - MachineExtension get(String resourceGroupName, String machineName, String extensionName); + Response getWithResponse( + String resourceGroupName, String machineName, String extensionName, Context context); /** * The operation to get the extension. @@ -54,14 +56,12 @@ public interface MachineExtensions { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the machine containing the extension. * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a Machine Extension. */ - Response getWithResponse( - String resourceGroupName, String machineName, String extensionName, Context context); + MachineExtension get(String resourceGroupName, String machineName, String extensionName); /** * The operation to get all extensions of a non-Azure machine. @@ -71,7 +71,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String machineName); @@ -85,7 +85,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result. + * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String machineName, String expand, Context context); @@ -96,7 +96,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response}. */ MachineExtension getById(String id); @@ -108,7 +108,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. + * @return describes a Machine Extension along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionsListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionsListResult.java index 93ece78747ea8..36e1ac43e5056 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionsListResult.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionsListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Describes the Machine Extensions List Result. */ @Fluent public final class MachineExtensionsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineExtensionsListResult.class); - /* * The list of extensions */ @@ -23,12 +19,16 @@ public final class MachineExtensionsListResult { private List value; /* - * The uri to fetch the next page of machine extensions. Call ListNext() - * with this to fetch the next page of extensions. + * The uri to fetch the next page of machine extensions. Call ListNext() with this to fetch the next page of + * extensions. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of MachineExtensionsListResult class. */ + public MachineExtensionsListResult() { + } + /** * Get the value property: The list of extensions. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineListResult.java index ca1354b8031cd..c2f873d2798ba 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineListResult.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineListResult.java @@ -7,15 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The List hybrid machine operation response. */ @Fluent public final class MachineListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineListResult.class); - /* * The list of hybrid machines. */ @@ -23,12 +20,16 @@ public final class MachineListResult { private List value; /* - * The URI to fetch the next page of Machines. Call ListNext() with this - * URI to fetch the next page of hybrid machines. + * The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the next page of hybrid + * machines. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of MachineListResult class. */ + public MachineListResult() { + } + /** * Get the value property: The list of hybrid machines. * @@ -78,11 +79,13 @@ public MachineListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property value in model MachineListResult")); } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(MachineListResult.class); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java index 80c22ae51e241..7916c8448b406 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java @@ -5,16 +5,13 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineUpdateProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Describes a hybrid machine Update. */ @Fluent public final class MachineUpdate extends ResourceUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MachineUpdate.class); - /* * Identity for the resource. */ @@ -25,7 +22,11 @@ public final class MachineUpdate extends ResourceUpdate { * Hybrid Compute Machine properties */ @JsonProperty(value = "properties") - private MachineUpdateProperties properties; + private MachineUpdateProperties innerProperties; + + /** Creates an instance of MachineUpdate class. */ + public MachineUpdate() { + } /** * Get the identity property: Identity for the resource. @@ -48,29 +49,137 @@ public MachineUpdate withIdentity(Identity identity) { } /** - * Get the properties property: Hybrid Compute Machine properties. + * Get the innerProperties property: Hybrid Compute Machine properties. + * + * @return the innerProperties value. + */ + private MachineUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MachineUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the locationData property: Metadata pertaining to the geographic location of the resource. * - * @return the properties value. + * @return the locationData value. */ - public MachineUpdateProperties properties() { - return this.properties; + public LocationData locationData() { + return this.innerProperties() == null ? null : this.innerProperties().locationData(); } /** - * Set the properties property: Hybrid Compute Machine properties. + * Set the locationData property: Metadata pertaining to the geographic location of the resource. * - * @param properties the properties value to set. + * @param locationData the locationData value to set. * @return the MachineUpdate object itself. */ - public MachineUpdate withProperties(MachineUpdateProperties properties) { - this.properties = properties; + public MachineUpdate withLocationData(LocationData locationData) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withLocationData(locationData); return this; } - /** {@inheritDoc} */ - @Override - public MachineUpdate withTags(Map tags) { - super.withTags(tags); + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.innerProperties() == null ? null : this.innerProperties().osProfile(); + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withOsProfile(OSProfile osProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().cloudMetadata(); + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withCloudMetadata(CloudMetadata cloudMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withCloudMetadata(cloudMetadata); + return this; + } + + /** + * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + public String parentClusterResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().parentClusterResourceId(); + } + + /** + * Set the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @param parentClusterResourceId the parentClusterResourceId value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withParentClusterResourceId(String parentClusterResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withParentClusterResourceId(parentClusterResourceId); + return this; + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopeResourceId(); + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); return this; } @@ -85,8 +194,8 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java index a5ee3e475805f..7f5e84f6e8e53 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java @@ -11,55 +11,55 @@ /** Resource collection API of Machines. */ public interface Machines { /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 machineName); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String machineName, Context context); /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response deleteWithResponse(String resourceGroupName, String machineName, Context context); + void deleteByResourceGroup(String resourceGroupName, String machineName); /** * Retrieves information about the model view or the instance view of a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a hybrid machine. + * @return describes a hybrid machine along with {@link Response}. */ - Machine getByResourceGroup(String resourceGroupName, String machineName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String machineName, InstanceViewTypes expand, Context context); /** * Retrieves information about the model view or the instance view of a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a hybrid machine. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String machineName, InstanceViewTypes expand, Context context); + Machine getByResourceGroup(String resourceGroupName, String machineName); /** * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get @@ -69,7 +69,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -82,7 +82,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -92,7 +92,7 @@ Response getByResourceGroupWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -104,7 +104,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List hybrid machine operation response. + * @return the List hybrid machine operation response as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java index 3f9e493402d3b..13fc8f1552b92 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java @@ -4,22 +4,34 @@ package com.azure.resourcemanager.hybridcompute.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** Specifies the operating system settings for the hybrid machine. */ -@Immutable +@Fluent public final class OSProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OSProfile.class); - /* * Specifies the host OS name of the hybrid machine. */ @JsonProperty(value = "computerName", access = JsonProperty.Access.WRITE_ONLY) private String computerName; + /* + * Specifies the windows configuration for update management. + */ + @JsonProperty(value = "windowsConfiguration") + private OSProfileWindowsConfiguration windowsConfiguration; + + /* + * Specifies the linux configuration for update management. + */ + @JsonProperty(value = "linuxConfiguration") + private OSProfileLinuxConfiguration linuxConfiguration; + + /** Creates an instance of OSProfile class. */ + public OSProfile() { + } + /** * Get the computerName property: Specifies the host OS name of the hybrid machine. * @@ -29,11 +41,57 @@ public String computerName() { return this.computerName; } + /** + * Get the windowsConfiguration property: Specifies the windows configuration for update management. + * + * @return the windowsConfiguration value. + */ + public OSProfileWindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: Specifies the windows configuration for update management. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withWindowsConfiguration(OSProfileWindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Get the linuxConfiguration property: Specifies the linux configuration for update management. + * + * @return the linuxConfiguration value. + */ + public OSProfileLinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: Specifies the linux configuration for update management. + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withLinuxConfiguration(OSProfileLinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java new file mode 100644 index 0000000000000..a0e71ea90fa39 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.PatchSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the linux configuration for update management. */ +@Fluent +public final class OSProfileLinuxConfiguration { + /* + * Specifies the patch settings. + */ + @JsonProperty(value = "patchSettings") + private PatchSettings innerPatchSettings; + + /** Creates an instance of OSProfileLinuxConfiguration class. */ + public OSProfileLinuxConfiguration() { + } + + /** + * Get the innerPatchSettings property: Specifies the patch settings. + * + * @return the innerPatchSettings value. + */ + private PatchSettings innerPatchSettings() { + return this.innerPatchSettings; + } + + /** + * Get the assessmentMode property: Specifies the assessment mode. + * + * @return the assessmentMode value. + */ + public AssessmentModeTypes assessmentMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); + } + + /** + * Set the assessmentMode property: Specifies the assessment mode. + * + * @param assessmentMode the assessmentMode value to set. + * @return the OSProfileLinuxConfiguration object itself. + */ + public OSProfileLinuxConfiguration withAssessmentMode(AssessmentModeTypes assessmentMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withAssessmentMode(assessmentMode); + return this; + } + + /** + * Get the patchMode property: Specifies the patch mode. + * + * @return the patchMode value. + */ + public PatchModeTypes patchMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); + } + + /** + * Set the patchMode property: Specifies the patch mode. + * + * @param patchMode the patchMode value to set. + * @return the OSProfileLinuxConfiguration object itself. + */ + public OSProfileLinuxConfiguration withPatchMode(PatchModeTypes patchMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withPatchMode(patchMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerPatchSettings() != null) { + innerPatchSettings().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java new file mode 100644 index 0000000000000..94a0146e8bb70 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.PatchSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the windows configuration for update management. */ +@Fluent +public final class OSProfileWindowsConfiguration { + /* + * Specifies the patch settings. + */ + @JsonProperty(value = "patchSettings") + private PatchSettings innerPatchSettings; + + /** Creates an instance of OSProfileWindowsConfiguration class. */ + public OSProfileWindowsConfiguration() { + } + + /** + * Get the innerPatchSettings property: Specifies the patch settings. + * + * @return the innerPatchSettings value. + */ + private PatchSettings innerPatchSettings() { + return this.innerPatchSettings; + } + + /** + * Get the assessmentMode property: Specifies the assessment mode. + * + * @return the assessmentMode value. + */ + public AssessmentModeTypes assessmentMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); + } + + /** + * Set the assessmentMode property: Specifies the assessment mode. + * + * @param assessmentMode the assessmentMode value to set. + * @return the OSProfileWindowsConfiguration object itself. + */ + public OSProfileWindowsConfiguration withAssessmentMode(AssessmentModeTypes assessmentMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withAssessmentMode(assessmentMode); + return this; + } + + /** + * Get the patchMode property: Specifies the patch mode. + * + * @return the patchMode value. + */ + public PatchModeTypes patchMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); + } + + /** + * Set the patchMode property: Specifies the patch mode. + * + * @param patchMode the patchMode value to set. + * @return the OSProfileWindowsConfiguration object itself. + */ + public OSProfileWindowsConfiguration withPatchMode(PatchModeTypes patchMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withPatchMode(patchMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerPatchSettings() != null) { + innerPatchSettings().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationListResult.java index 9e073c279c1d9..b3560ccb18b8b 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationListResult.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationListResult.java @@ -5,23 +5,23 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The List Compute Operation operation response. */ @Immutable public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* * The list of compute operations */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: The list of compute operations. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java index 55fd882ca6eff..d9d9443f385b6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java @@ -29,6 +29,13 @@ public interface OperationValue { */ OperationValueDisplay display(); + /** + * Gets the isDataAction property: This property indicates if the operation is an action or a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + /** * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner object. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValueDisplay.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValueDisplay.java index 758cb096d8862..9b071e79c3d19 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValueDisplay.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValueDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the properties of a Hybrid Compute Operation Value Display. */ @Immutable public final class OperationValueDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationValueDisplay.class); - /* * The display name of the compute operation. */ @@ -38,6 +34,10 @@ public final class OperationValueDisplay { @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; + /** Creates an instance of OperationValueDisplay class. */ + public OperationValueDisplay() { + } + /** * Get the operation property: The display name of the compute operation. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Operations.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Operations.java index 9808ce441289d..be231cbcd8bcb 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Operations.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @throws com.azure.core.management.exception.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 hybrid compute operations. + * @return a list of hybrid compute operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 hybrid compute operations. + * @return a list of hybrid compute operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.java new file mode 100644 index 0000000000000..d300f2658bc3c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.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.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the patch mode. */ +public final class PatchModeTypes extends ExpandableStringEnum { + /** Static value ImageDefault for PatchModeTypes. */ + public static final PatchModeTypes IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for PatchModeTypes. */ + public static final PatchModeTypes AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** Static value AutomaticByOS for PatchModeTypes. */ + public static final PatchModeTypes AUTOMATIC_BY_OS = fromString("AutomaticByOS"); + + /** Static value Manual for PatchModeTypes. */ + public static final PatchModeTypes MANUAL = fromString("Manual"); + + /** + * Creates or finds a PatchModeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchModeTypes. + */ + @JsonCreator + public static PatchModeTypes fromString(String name) { + return fromString(name, PatchModeTypes.class); + } + + /** + * Gets known PatchModeTypes values. + * + * @return known PatchModeTypes values. + */ + public static Collection values() { + return values(PatchModeTypes.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java index b93097f1f6292..1e05e2391b4a1 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java @@ -39,12 +39,19 @@ public interface PrivateEndpointConnection { PrivateEndpointConnectionProperties properties(); /** - * Gets the systemData property: The system meta data relating to this resource. + * 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.hybridcompute.fluent.models.PrivateEndpointConnectionInner object. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java new file mode 100644 index 0000000000000..3c6a86dfefaf3 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Data Model for a Private Endpoint Connection associated with a Private Link Scope. */ +@Fluent +public final class PrivateEndpointConnectionDataModel { + /* + * The ARM Resource Id of the Private Endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The Name of the Private Endpoint. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Azure resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The Private Endpoint Connection properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties properties; + + /** Creates an instance of PrivateEndpointConnectionDataModel class. */ + public PrivateEndpointConnectionDataModel() { + } + + /** + * Get the id property: The ARM Resource Id of the Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The Name of the Private Endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Azure resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the properties property: The Private Endpoint Connection properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The Private Endpoint Connection properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionDataModel object itself. + */ + public PrivateEndpointConnectionDataModel withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionListResult.java index f57f7dc476ded..4419f1750da4e 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionListResult.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A list of private endpoint connections. */ @Immutable public final class PrivateEndpointConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); - /* * Array of results. */ @@ -28,6 +24,10 @@ public final class PrivateEndpointConnectionListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + /** * Get the value property: Array of results. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java index c65f392818685..b274d8abd3673 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java @@ -5,15 +5,12 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Properties of a private endpoint connection. */ @Fluent public final class PrivateEndpointConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); - /* * Private endpoint which the connection belongs to. */ @@ -32,6 +29,16 @@ public final class PrivateEndpointConnectionProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; + /* + * List of group IDs. + */ + @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) + private List groupIds; + + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + /** * Get the privateEndpoint property: Private endpoint which the connection belongs to. * @@ -82,6 +89,15 @@ public String provisioningState() { return this.provisioningState; } + /** + * Get the groupIds property: List of group IDs. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + /** * Validates the instance. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnections.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnections.java index b9bdfd5572317..9817927f1c7f7 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnections.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnections.java @@ -16,12 +16,14 @@ public interface PrivateEndpointConnections { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection along with {@link Response}. */ - PrivateEndpointConnection get(String resourceGroupName, String scopeName, String privateEndpointConnectionName); + Response getWithResponse( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); /** * Gets a private endpoint connection. @@ -29,14 +31,12 @@ public interface PrivateEndpointConnections { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection. */ - Response getWithResponse( - String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnection get(String resourceGroupName, String scopeName, String privateEndpointConnectionName); /** * Deletes a private endpoint connection with a given name. @@ -71,7 +71,8 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. */ PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); @@ -84,7 +85,8 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a private link scope. + * @return all private endpoint connections on a private link scope as paginated response with {@link + * PagedIterable}. */ PagedIterable listByPrivateLinkScope( String resourceGroupName, String scopeName, Context context); @@ -96,7 +98,7 @@ PagedIterable listByPrivateLinkScope( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection along with {@link Response}. */ PrivateEndpointConnection getById(String id); @@ -108,7 +110,7 @@ PagedIterable listByPrivateLinkScope( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. + * @return a private endpoint connection along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointProperty.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointProperty.java index 8ae7060b370e4..185de32f28eb9 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointProperty.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointProperty.java @@ -5,21 +5,21 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Private endpoint which the connection belongs to. */ @Fluent public final class PrivateEndpointProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointProperty.class); - /* * Resource id of the private endpoint. */ @JsonProperty(value = "id") private String id; + /** Creates an instance of PrivateEndpointProperty class. */ + public PrivateEndpointProperty() { + } + /** * Get the id property: Resource id of the private endpoint. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java index 08854540c62b5..4cc8d1e89a25f 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java @@ -38,7 +38,7 @@ public interface PrivateLinkResource { PrivateLinkResourceProperties properties(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResourceListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResourceListResult.java index 82a426fc73cc2..f486303008aeb 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResourceListResult.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResourceListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A list of private link resources. */ @Immutable public final class PrivateLinkResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResult.class); - /* * Array of results. */ @@ -28,6 +24,10 @@ public final class PrivateLinkResourceListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of PrivateLinkResourceListResult class. */ + public PrivateLinkResourceListResult() { + } + /** * Get the value property: Array of results. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResourceProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResourceProperties.java index 073da50f823b1..fc90aa123de74 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResourceProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResourceProperties.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Properties of a private link resource. */ @Immutable public final class PrivateLinkResourceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); - /* * The private link resource group id. */ @@ -33,6 +29,10 @@ public final class PrivateLinkResourceProperties { @JsonProperty(value = "requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) private List requiredZoneNames; + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + /** * Get the groupId property: The private link resource group id. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResources.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResources.java index c4432070bb366..a6a4040c945eb 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResources.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResources.java @@ -18,7 +18,8 @@ public interface PrivateLinkResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. */ PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); @@ -31,7 +32,8 @@ public interface PrivateLinkResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope as paginated + * response with {@link PagedIterable}. */ PagedIterable listByPrivateLinkScope( String resourceGroupName, String scopeName, Context context); @@ -42,12 +44,15 @@ PagedIterable listByPrivateLinkScope( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with {@link + * Response}. */ - PrivateLinkResource get(String resourceGroupName, String scopeName, String groupName); + Response getWithResponse( + String resourceGroupName, String scopeName, String groupName, Context context); /** * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. @@ -55,12 +60,10 @@ PagedIterable listByPrivateLinkScope( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope resource. * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. */ - Response getWithResponse( - String resourceGroupName, String scopeName, String groupName, Context context); + PrivateLinkResource get(String resourceGroupName, String scopeName, String groupName); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkScopes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkScopes.java index abc5715a641a6..11e03d6bdf210 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkScopes.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkScopes.java @@ -15,7 +15,8 @@ public interface PrivateLinkScopes { * * @throws com.azure.core.management.exception.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 all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. */ PagedIterable list(); @@ -26,7 +27,8 @@ public interface PrivateLinkScopes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 all Azure Arc PrivateLinkScopes within a subscription. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with {@link + * PagedIterable}. */ PagedIterable list(Context context); @@ -37,7 +39,8 @@ public interface PrivateLinkScopes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,7 +52,8 @@ public interface PrivateLinkScopes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Azure Arc PrivateLinkScopes within a resource group. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with {@link + * PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -81,78 +85,78 @@ public interface PrivateLinkScopes { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope 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 an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. */ - HybridComputePrivateLinkScope getByResourceGroup(String resourceGroupName, String scopeName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String scopeName, Context context); /** * Returns a Azure Arc PrivateLinkScope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scopeName The name of the Azure Arc PrivateLinkScope 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 an Azure Arc PrivateLinkScope definition. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String scopeName, Context context); + HybridComputePrivateLinkScope getByResourceGroup(String resourceGroupName, String scopeName); /** * Returns a Azure Arc PrivateLinkScope's validation details. * * @param location The location of the target resource. * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope 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 response. + * @return the response body along with {@link Response}. */ - PrivateLinkScopeValidationDetails getValidationDetails(String location, String privateLinkScopeId); + Response getValidationDetailsWithResponse( + String location, String privateLinkScopeId, Context context); /** * Returns a Azure Arc PrivateLinkScope's validation details. * * @param location The location of the target resource. * @param privateLinkScopeId The id (Guid) of the Azure Arc PrivateLinkScope 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 response. */ - Response getValidationDetailsWithResponse( - String location, String privateLinkScopeId, Context context); + PrivateLinkScopeValidationDetails getValidationDetails(String location, String privateLinkScopeId); /** * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the target machine to get the private link scope validation details for. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ - PrivateLinkScopeValidationDetails getValidationDetailsForMachine(String resourceGroupName, String machineName); + Response getValidationDetailsForMachineWithResponse( + String resourceGroupName, String machineName, Context context); /** * Returns a Azure Arc PrivateLinkScope's validation details for a given machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the target machine to get the private link scope validation details for. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - Response getValidationDetailsForMachineWithResponse( - String resourceGroupName, String machineName, Context context); + PrivateLinkScopeValidationDetails getValidationDetailsForMachine(String resourceGroupName, String machineName); /** * Returns a Azure Arc PrivateLinkScope. @@ -161,7 +165,7 @@ Response getValidationDetailsForMachineWithRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. */ HybridComputePrivateLinkScope getById(String id); @@ -173,7 +177,7 @@ Response getValidationDetailsForMachineWithRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Arc PrivateLinkScope definition. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkScopesResource.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkScopesResource.java index 33009e13f8100..0ff041dd66af1 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkScopesResource.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkScopesResource.java @@ -4,16 +4,16 @@ package com.azure.resourcemanager.hybridcompute.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** An azure resource object. */ -@Immutable +@Fluent public class PrivateLinkScopesResource extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkScopesResource.class); + /** Creates an instance of PrivateLinkScopesResource class. */ + public PrivateLinkScopesResource() { + } /** {@inheritDoc} */ @Override diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkServiceConnectionStateProperty.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkServiceConnectionStateProperty.java index baa9ebd217feb..bcb2bdb1c2782 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkServiceConnectionStateProperty.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkServiceConnectionStateProperty.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** State of the private endpoint connection. */ @Fluent public final class PrivateLinkServiceConnectionStateProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionStateProperty.class); - /* * The private link service connection status. */ @@ -32,6 +29,10 @@ public final class PrivateLinkServiceConnectionStateProperty { @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) private String actionsRequired; + /** Creates an instance of PrivateLinkServiceConnectionStateProperty class. */ + public PrivateLinkServiceConnectionStateProperty() { + } + /** * Get the status property: The private link service connection status. * @@ -88,16 +89,18 @@ public String actionsRequired() { */ public void validate() { if (status() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property status in model PrivateLinkServiceConnectionStateProperty")); } if (description() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property description in model PrivateLinkServiceConnectionStateProperty")); } } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkServiceConnectionStateProperty.class); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PublicNetworkAccessType.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PublicNetworkAccessType.java index 12f0eb7cfe904..90b8abd6a4221 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PublicNetworkAccessType.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PublicNetworkAccessType.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for PublicNetworkAccessType. */ +/** + * The network access policy to determine if Azure Arc agents can use public Azure Arc service endpoints. Defaults to + * disabled (access to Azure Arc services only via private link). + */ public final class PublicNetworkAccessType extends ExpandableStringEnum { /** Static value Enabled for PublicNetworkAccessType. */ public static final PublicNetworkAccessType ENABLED = fromString("Enabled"); @@ -27,7 +30,11 @@ public static PublicNetworkAccessType fromString(String name) { return fromString(name, PublicNetworkAccessType.class); } - /** @return known PublicNetworkAccessType values. */ + /** + * Gets known PublicNetworkAccessType values. + * + * @return known PublicNetworkAccessType values. + */ public static Collection values() { return values(PublicNetworkAccessType.class); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceIdentityType.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceIdentityType.java index 58b235982b4e0..b3e8d8bcf620d 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceIdentityType.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceIdentityType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for ResourceIdentityType. */ +/** The identity type. */ public enum ResourceIdentityType { /** Enum value SystemAssigned. */ SYSTEM_ASSIGNED("SystemAssigned"); @@ -27,6 +27,9 @@ public enum ResourceIdentityType { */ @JsonCreator public static ResourceIdentityType fromString(String value) { + if (value == null) { + return null; + } ResourceIdentityType[] items = ResourceIdentityType.values(); for (ResourceIdentityType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -36,6 +39,7 @@ public static ResourceIdentityType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java new file mode 100644 index 0000000000000..03fb8081c7387 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceUpdate.java index 21efd8494a017..b73e119a620ec 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceUpdate.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceUpdate.java @@ -5,22 +5,24 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The Update Resource model definition. */ @Fluent public class ResourceUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUpdate.class); - /* * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of ResourceUpdate class. */ + public ResourceUpdate() { + } + /** * Get the tags property: Resource tags. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.java new file mode 100644 index 0000000000000..3542d05c0dd80 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.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.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the status and behavior of a service. */ +@Fluent +public final class ServiceStatus { + /* + * The current status of the service. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The behavior of the service when the Arc-enabled machine starts up. + */ + @JsonProperty(value = "startupType") + private String startupType; + + /** Creates an instance of ServiceStatus class. */ + public ServiceStatus() { + } + + /** + * Get the status property: The current status of the service. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The current status of the service. + * + * @param status the status value to set. + * @return the ServiceStatus object itself. + */ + public ServiceStatus withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startupType property: The behavior of the service when the Arc-enabled machine starts up. + * + * @return the startupType value. + */ + public String startupType() { + return this.startupType; + } + + /** + * Set the startupType property: The behavior of the service when the Arc-enabled machine starts up. + * + * @param startupType the startupType value to set. + * @return the ServiceStatus object itself. + */ + public ServiceStatus withStartupType(String startupType) { + this.startupType = startupType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java new file mode 100644 index 0000000000000..5506fa84ce22e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reports the state and behavior of dependent services. */ +@Fluent +public final class ServiceStatuses { + /* + * The state of the extension service on the Arc-enabled machine. + */ + @JsonProperty(value = "extensionService") + private ServiceStatus extensionService; + + /* + * The state of the guest configuration service on the Arc-enabled machine. + */ + @JsonProperty(value = "guestConfigurationService") + private ServiceStatus guestConfigurationService; + + /** Creates an instance of ServiceStatuses class. */ + public ServiceStatuses() { + } + + /** + * Get the extensionService property: The state of the extension service on the Arc-enabled machine. + * + * @return the extensionService value. + */ + public ServiceStatus extensionService() { + return this.extensionService; + } + + /** + * Set the extensionService property: The state of the extension service on the Arc-enabled machine. + * + * @param extensionService the extensionService value to set. + * @return the ServiceStatuses object itself. + */ + public ServiceStatuses withExtensionService(ServiceStatus extensionService) { + this.extensionService = extensionService; + return this; + } + + /** + * Get the guestConfigurationService property: The state of the guest configuration service on the Arc-enabled + * machine. + * + * @return the guestConfigurationService value. + */ + public ServiceStatus guestConfigurationService() { + return this.guestConfigurationService; + } + + /** + * Set the guestConfigurationService property: The state of the guest configuration service on the Arc-enabled + * machine. + * + * @param guestConfigurationService the guestConfigurationService value to set. + * @return the ServiceStatuses object itself. + */ + public ServiceStatuses withGuestConfigurationService(ServiceStatus guestConfigurationService) { + this.guestConfigurationService = guestConfigurationService; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionService() != null) { + extensionService().validate(); + } + if (guestConfigurationService() != null) { + guestConfigurationService().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/StatusLevelTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/StatusLevelTypes.java index c6998030f7e3e..6a83d84a3b7c8 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/StatusLevelTypes.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/StatusLevelTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for StatusLevelTypes. */ +/** The level code. */ public final class StatusLevelTypes extends ExpandableStringEnum { /** Static value Info for StatusLevelTypes. */ public static final StatusLevelTypes INFO = fromString("Info"); @@ -30,7 +30,11 @@ public static StatusLevelTypes fromString(String name) { return fromString(name, StatusLevelTypes.class); } - /** @return known StatusLevelTypes values. */ + /** + * Gets known StatusLevelTypes values. + * + * @return known StatusLevelTypes values. + */ public static Collection values() { return values(StatusLevelTypes.class); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/StatusTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/StatusTypes.java index b56ff0418db2d..c5293fc97ccee 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/StatusTypes.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/StatusTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for StatusTypes. */ +/** The status of the hybrid machine agent. */ public final class StatusTypes extends ExpandableStringEnum { /** Static value Connected for StatusTypes. */ public static final StatusTypes CONNECTED = fromString("Connected"); @@ -30,7 +30,11 @@ public static StatusTypes fromString(String name) { return fromString(name, StatusTypes.class); } - /** @return known StatusTypes values. */ + /** + * Gets known StatusTypes values. + * + * @return known StatusTypes values. + */ public static Collection values() { return values(StatusTypes.class); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/TagsResource.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/TagsResource.java index 2ce35e9ad3279..e74821d927e16 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/TagsResource.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/TagsResource.java @@ -5,8 +5,7 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -16,14 +15,17 @@ */ @Fluent public final class TagsResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsResource.class); - /* * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of TagsResource class. */ + public TagsResource() { + } + /** * Get the tags property: Resource tags. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java new file mode 100644 index 0000000000000..a611aaae6e889 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for ExtensionMetadata Get. */ +public final class ExtensionMetadataGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/ExtensionMetadata_Get.json + */ + /** + * Sample code: GET an extensions metadata. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAnExtensionsMetadata(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .getWithResponse("EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", "1.9.1", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.java new file mode 100644 index 0000000000000..a60a90ad4da0c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for ExtensionMetadata List. */ +public final class ExtensionMetadataListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/ExtensionMetadata_List.json + */ + /** + * Sample code: GET a list of extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAListOfExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.extensionMetadatas().list("EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..521430bb2492c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for MachineExtensions CreateOrUpdate. */ +public final class MachineExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PUTExtension.json + */ + /** + * Sample code: Create or Update a Machine Extension. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateAMachineExtension( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineExtensions() + .define("CustomScriptExtension") + .withRegion("eastus2euap") + .withExistingMachine("myResourceGroup", "myMachine") + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java new file mode 100644 index 0000000000000..1ec3c16504c63 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for MachineExtensions Delete. */ +public final class MachineExtensionsDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/DELETEExtension.json + */ + /** + * Sample code: Delete a Machine Extension. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteAMachineExtension(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machineExtensions().delete("myResourceGroup", "myMachine", "MMA", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java new file mode 100644 index 0000000000000..260993a9840e8 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for MachineExtensions Get. */ +public final class MachineExtensionsGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/GETExtension.json + */ + /** + * Sample code: GET Machine Extension. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETMachineExtension(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .machineExtensions() + .getWithResponse("myResourceGroup", "myMachine", "CustomScriptExtension", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java new file mode 100644 index 0000000000000..1fe50b81cac6a --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for MachineExtensions List. */ +public final class MachineExtensionsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/LISTExtension.json + */ + /** + * Sample code: GET all Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAllMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machineExtensions().list("myResourceGroup", "myMachine", null, Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java new file mode 100644 index 0000000000000..dd725fa97ae40 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.models.MachineExtension; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MachineExtensions Update. */ +public final class MachineExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/UpdateExtension.json + */ + /** + * Sample code: Create or Update a Machine Extension. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void createOrUpdateAMachineExtension( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + MachineExtension resource = + manager + .machineExtensions() + .getWithResponse("myResourceGroup", "myMachine", "CustomScriptExtension", Context.NONE) + .getValue(); + resource + .update() + .withPublisher("Microsoft.Compute") + .withType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(true) + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"")) + .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/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java new file mode 100644 index 0000000000000..79de22eabd961 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for Machines Delete. */ +public final class MachinesDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Machines_Delete.json + */ + /** + * Sample code: Delete a Machine. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deleteAMachine(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().deleteByResourceGroupWithResponse("myResourceGroup", "myMachine", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..3ded793094be0 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for Machines GetByResourceGroup. */ +public final class MachinesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Machines_Get.json + */ + /** + * Sample code: Get Machine. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getMachine(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().getByResourceGroupWithResponse("myResourceGroup", "myMachine", null, Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ecac5c44627ce --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for Machines ListByResourceGroup. */ +public final class MachinesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Machines_ListByResourceGroup.json + */ + /** + * Sample code: List Machines by resource group. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listMachinesByResourceGroup( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().listByResourceGroup("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java new file mode 100644 index 0000000000000..d48389a291a64 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for Machines List. */ +public final class MachinesListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Machines_ListBySubscription.json + */ + /** + * Sample code: List Machines by resource group. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listMachinesByResourceGroup( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.machines().list(Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..1a979b0313e3e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Operations_List.json + */ + /** + * Sample code: List Hybrid Compute Provider Operations. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listHybridComputeProviderOperations( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..168c752216878 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateEndpointConnections() + .define("private-endpoint-connection-name") + .withExistingPrivateLinkScope("myResourceGroup", "myPrivateLinkScope") + .withProperties( + new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionStateProperty() + .withStatus("Approved") + .withDescription("Approved by johndoe@contoso.com"))) + .create(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..8ca4aa96fa98d --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateEndpointConnections() + .delete("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..69a454135f838 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java new file mode 100644 index 0000000000000..caae37c361b35 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByPrivateLinkScope. */ +public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: Gets list of private endpoint connections on a private link scope. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateEndpointConnections() + .listByPrivateLinkScope("myResourceGroup", "myPrivateLinkScope", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 0000000000000..ea57142d28fc2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkResources() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "hybridcompute", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java new file mode 100644 index 0000000000000..6465af2473c45 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByPrivateLinkScope. */ +public final class PrivateLinkResourcesListByPrivateLinkScopeSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.privateLinkResources().listByPrivateLinkScope("myResourceGroup", "myPrivateLinkScope", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5e84cb1e868a8 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for PrivateLinkScopes CreateOrUpdate. */ +public final class PrivateLinkScopesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesCreate.json + */ + /** + * Sample code: PrivateLinkScopeCreate. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeCreate(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .create(); + } + + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesUpdate.json + */ + /** + * Sample code: PrivateLinkScopeUpdate. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeUpdate(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("Tag1", "Value1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java new file mode 100644 index 0000000000000..6b2736f58844c --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes Delete. */ +public final class PrivateLinkScopesDeleteSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesDelete.json + */ + /** + * Sample code: PrivateLinkScopesDelete. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopesDelete(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.privateLinkScopes().delete("my-resource-group", "my-privatelinkscope", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..93a34046c3bc6 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetByResourceGroup. */ +public final class PrivateLinkScopesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesGet.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeGet(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java new file mode 100644 index 0000000000000..c56e3147ebf55 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetValidationDetailsForMachine. */ +public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesGetValidationForMachine.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeGet(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .getValidationDetailsForMachineWithResponse("my-resource-group", "machineName", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java new file mode 100644 index 0000000000000..77d6e420eb7d2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes GetValidationDetails. */ +public final class PrivateLinkScopesGetValidationDetailsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesGetValidation.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeGet(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .privateLinkScopes() + .getValidationDetailsWithResponse("wus2", "f5dc51d3-92ed-4d7e-947a-775ea79b4919", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..de85571b23a8d --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes ListByResourceGroup. */ +public final class PrivateLinkScopesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesListByResourceGroup.json + */ + /** + * Sample code: PrivateLinkScopeListByResourceGroup. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeListByResourceGroup( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.privateLinkScopes().listByResourceGroup("my-resource-group", Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java new file mode 100644 index 0000000000000..e8b66be857be5 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkScopes List. */ +public final class PrivateLinkScopesListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesList.json + */ + /** + * Sample code: PrivateLinkScopesList.json. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopesListJson(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.privateLinkScopes().list(Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java new file mode 100644 index 0000000000000..22cf4364ce1de --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.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.hybridcompute.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PrivateLinkScopes UpdateTags. */ +public final class PrivateLinkScopesUpdateTagsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + */ + /** + * Sample code: PrivateLinkScopeUpdateTagsOnly. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void privateLinkScopeUpdateTagsOnly( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + HybridComputePrivateLinkScope resource = + manager + .privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java new file mode 100644 index 0000000000000..785f434c03127 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.models.ExtensionTargetProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ResourceProvider UpgradeExtensions. */ +public final class ResourceProviderUpgradeExtensionsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-08-11-preview/examples/Extensions_Upgrade.json + */ + /** + * Sample code: Upgrade Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void upgradeMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .resourceProviders() + .upgradeExtensions( + "myResourceGroup", + "myMachine", + new MachineExtensionUpgrade() + .withExtensionTargets( + mapOf( + "Microsoft.Azure.Monitoring", + new ExtensionTargetProperties().withTargetVersion("2.0"), + "Microsoft.Compute.CustomScriptExtension", + new ExtensionTargetProperties().withTargetVersion("1.10"))), + 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; + } +}