diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md index 7c9638cae4706..22eb97a89cada 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-03-09) +- Azure Resource Manager AzureStackHci client library for Java. This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-preview-2021-07. 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-12) diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md index 70d752936ae75..b71169d723d84 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureStackHci client library for Java. -This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2020-10. 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 AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-preview-2021-07. 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-azurestackhci - 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/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md new file mode 100644 index 0000000000000..b8709821632d7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md @@ -0,0 +1,1106 @@ +# Code snippets and samples + + +## GalleryimagesOperation + +- [CreateOrUpdate](#galleryimagesoperation_createorupdate) +- [Delete](#galleryimagesoperation_delete) +- [GetByResourceGroup](#galleryimagesoperation_getbyresourcegroup) +- [List](#galleryimagesoperation_list) +- [ListByResourceGroup](#galleryimagesoperation_listbyresourcegroup) +- [Update](#galleryimagesoperation_update) + +## NetworkinterfacesOperation + +- [CreateOrUpdate](#networkinterfacesoperation_createorupdate) +- [Delete](#networkinterfacesoperation_delete) +- [GetByResourceGroup](#networkinterfacesoperation_getbyresourcegroup) +- [List](#networkinterfacesoperation_list) +- [ListByResourceGroup](#networkinterfacesoperation_listbyresourcegroup) +- [Update](#networkinterfacesoperation_update) + +## StoragecontainersOperation + +- [CreateOrUpdate](#storagecontainersoperation_createorupdate) +- [Delete](#storagecontainersoperation_delete) +- [GetByResourceGroup](#storagecontainersoperation_getbyresourcegroup) +- [List](#storagecontainersoperation_list) +- [ListByResourceGroup](#storagecontainersoperation_listbyresourcegroup) +- [Update](#storagecontainersoperation_update) + +## VirtualharddisksOperation + +- [CreateOrUpdate](#virtualharddisksoperation_createorupdate) +- [Delete](#virtualharddisksoperation_delete) +- [GetByResourceGroup](#virtualharddisksoperation_getbyresourcegroup) +- [List](#virtualharddisksoperation_list) +- [ListByResourceGroup](#virtualharddisksoperation_listbyresourcegroup) +- [Update](#virtualharddisksoperation_update) + +## VirtualmachinesOperation + +- [CreateOrUpdate](#virtualmachinesoperation_createorupdate) +- [Delete](#virtualmachinesoperation_delete) +- [GetByResourceGroup](#virtualmachinesoperation_getbyresourcegroup) +- [List](#virtualmachinesoperation_list) +- [ListByResourceGroup](#virtualmachinesoperation_listbyresourcegroup) +- [Restart](#virtualmachinesoperation_restart) +- [Start](#virtualmachinesoperation_start) +- [Stop](#virtualmachinesoperation_stop) +- [Update](#virtualmachinesoperation_update) + +## VirtualnetworksOperation + +- [CreateOrUpdate](#virtualnetworksoperation_createorupdate) +- [Delete](#virtualnetworksoperation_delete) +- [GetByResourceGroup](#virtualnetworksoperation_getbyresourcegroup) +- [List](#virtualnetworksoperation_list) +- [ListByResourceGroup](#virtualnetworksoperation_listbyresourcegroup) +- [Update](#virtualnetworksoperation_update) +### GalleryimagesOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesExtendedLocation; + +/** Samples for GalleryimagesOperation CreateOrUpdate. */ +public final class GalleryimagesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutGalleryImage.json + */ + /** + * Sample code: PutGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .galleryimagesOperations() + .define("test-gallery-image") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new GalleryimagesExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withContainerName("Default_Container") + .withImagePath("C:\\test.vhdx") + .create(); + } +} +``` + +### GalleryimagesOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for GalleryimagesOperation Delete. */ +public final class GalleryimagesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteGalleryImage.json + */ + /** + * Sample code: DeleteGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryimagesOperations().deleteWithResponse("test-rg", "test-gallery-image", Context.NONE); + } +} +``` + +### GalleryimagesOperation_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for GalleryimagesOperation GetByResourceGroup. */ +public final class GalleryimagesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetGalleryImage.json + */ + /** + * Sample code: GetGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryimagesOperations().getByResourceGroupWithResponse("test-rg", "test-gallery-image", Context.NONE); + } +} +``` + +### GalleryimagesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for GalleryimagesOperation List. */ +public final class GalleryimagesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListGalleryImageBySubscription.json + */ + /** + * Sample code: ListGalleryImageByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listGalleryImageByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryimagesOperations().list(Context.NONE); + } +} +``` + +### GalleryimagesOperation_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for GalleryimagesOperation ListByResourceGroup. */ +public final class GalleryimagesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListGalleryImageByResourceGroup.json + */ + /** + * Sample code: ListGalleryImageByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listGalleryImageByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryimagesOperations().listByResourceGroup("test-rg", Context.NONE); + } +} +``` + +### GalleryimagesOperation_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Galleryimages; +import java.util.HashMap; +import java.util.Map; + +/** Samples for GalleryimagesOperation Update. */ +public final class GalleryimagesOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateGalleryImage.json + */ + /** + * Sample code: UpdateGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Galleryimages resource = + manager + .galleryimagesOperations() + .getByResourceGroupWithResponse("test-rg", "test-gallery-image", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; + } +} +``` + +### NetworkinterfacesOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.azure.resourcemanager.azurestackhci.models.IpConfigurationProperties; +import com.azure.resourcemanager.azurestackhci.models.IpConfigurationPropertiesSubnet; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesExtendedLocation; +import java.util.Arrays; + +/** Samples for NetworkinterfacesOperation CreateOrUpdate. */ +public final class NetworkinterfacesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutNetworkInterface.json + */ + /** + * Sample code: PutNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .networkinterfacesOperations() + .define("test-nic") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new NetworkinterfacesExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withIpConfigurations( + Arrays + .asList( + new IpConfiguration() + .withName("ipconfig-sample") + .withProperties( + new IpConfigurationProperties() + .withSubnet(new IpConfigurationPropertiesSubnet().withId("test-vnet"))))) + .create(); + } +} +``` + +### NetworkinterfacesOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkinterfacesOperation Delete. */ +public final class NetworkinterfacesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteNetworkInterface.json + */ + /** + * Sample code: DeleteNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkinterfacesOperations().deleteWithResponse("test-rg", "test-nic", Context.NONE); + } +} +``` + +### NetworkinterfacesOperation_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkinterfacesOperation GetByResourceGroup. */ +public final class NetworkinterfacesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetNetworkInterface.json + */ + /** + * Sample code: GetNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkinterfacesOperations().getByResourceGroupWithResponse("test-rg", "test-nic", Context.NONE); + } +} +``` + +### NetworkinterfacesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkinterfacesOperation List. */ +public final class NetworkinterfacesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListNetworkInterfaceBySubscription.json + */ + /** + * Sample code: ListNetworkInterfaceBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listNetworkInterfaceBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkinterfacesOperations().list(Context.NONE); + } +} +``` + +### NetworkinterfacesOperation_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkinterfacesOperation ListByResourceGroup. */ +public final class NetworkinterfacesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListNetworkInterfaceByResourceGroup.json + */ + /** + * Sample code: ListNetworkInterfaceByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listNetworkInterfaceByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkinterfacesOperations().listByResourceGroup("test-rg", Context.NONE); + } +} +``` + +### NetworkinterfacesOperation_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Networkinterfaces; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkinterfacesOperation Update. */ +public final class NetworkinterfacesOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateNetworkInterface.json + */ + /** + * Sample code: UpdateNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Networkinterfaces resource = + manager + .networkinterfacesOperations() + .getByResourceGroupWithResponse("test-rg", "test-nic", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; + } +} +``` + +### StoragecontainersOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersExtendedLocation; + +/** Samples for StoragecontainersOperation CreateOrUpdate. */ +public final class StoragecontainersOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutStorageContainer.json + */ + /** + * Sample code: PutStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .storagecontainersOperations() + .define("Default_Container") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new StoragecontainersExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withPath("C:\\container_storage") + .create(); + } +} +``` + +### StoragecontainersOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for StoragecontainersOperation Delete. */ +public final class StoragecontainersOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteStorageContainer.json + */ + /** + * Sample code: DeleteStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storagecontainersOperations().deleteWithResponse("test-rg", "Default_Container", Context.NONE); + } +} +``` + +### StoragecontainersOperation_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for StoragecontainersOperation GetByResourceGroup. */ +public final class StoragecontainersOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetStorageContainer.json + */ + /** + * Sample code: GetStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .storagecontainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", Context.NONE); + } +} +``` + +### StoragecontainersOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for StoragecontainersOperation List. */ +public final class StoragecontainersOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListStorageContainerBySubscription.json + */ + /** + * Sample code: ListStorageContainerByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listStorageContainerByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storagecontainersOperations().list(Context.NONE); + } +} +``` + +### StoragecontainersOperation_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for StoragecontainersOperation ListByResourceGroup. */ +public final class StoragecontainersOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListStorageContainerByResourceGroup.json + */ + /** + * Sample code: ListStorageContainerByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listStorageContainerByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storagecontainersOperations().listByResourceGroup("test-rg", Context.NONE); + } +} +``` + +### StoragecontainersOperation_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Storagecontainers; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StoragecontainersOperation Update. */ +public final class StoragecontainersOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateStorageContainer.json + */ + /** + * Sample code: UpdateStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Storagecontainers resource = + manager + .storagecontainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; + } +} +``` + +### VirtualharddisksOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksExtendedLocation; + +/** Samples for VirtualharddisksOperation CreateOrUpdate. */ +public final class VirtualharddisksOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutVirtualHardDisk.json + */ + /** + * Sample code: PutVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualharddisksOperations() + .define("test-vhd") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new VirtualharddisksExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withDiskSizeBytes(32L) + .create(); + } +} +``` + +### VirtualharddisksOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualharddisksOperation Delete. */ +public final class VirtualharddisksOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteVirtualHardDisk.json + */ + /** + * Sample code: DeleteVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualharddisksOperations().deleteWithResponse("test-rg", "test-vhd", Context.NONE); + } +} +``` + +### VirtualharddisksOperation_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualharddisksOperation GetByResourceGroup. */ +public final class VirtualharddisksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetVirtualHardDisk.json + */ + /** + * Sample code: GetVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualharddisksOperations().getByResourceGroupWithResponse("test-rg", "test-vhd", Context.NONE); + } +} +``` + +### VirtualharddisksOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualharddisksOperation List. */ +public final class VirtualharddisksOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualHardDiskBySubscription.json + */ + /** + * Sample code: ListVirtualHardDiskByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualHardDiskByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualharddisksOperations().list(Context.NONE); + } +} +``` + +### VirtualharddisksOperation_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualharddisksOperation ListByResourceGroup. */ +public final class VirtualharddisksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualHardDiskByResourceGroup.json + */ + /** + * Sample code: ListVirtualHardDiskByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualHardDiskByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualharddisksOperations().listByResourceGroup("test-rg", Context.NONE); + } +} +``` + +### VirtualharddisksOperation_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Virtualharddisks; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualharddisksOperation Update. */ +public final class VirtualharddisksOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateVirtualHardDisk.json + */ + /** + * Sample code: UpdateVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Virtualharddisks resource = + manager + .virtualharddisksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vhd", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; + } +} +``` + +### VirtualmachinesOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesStorageProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesStorageProfileImageReference; +import java.util.Arrays; + +/** Samples for VirtualmachinesOperation CreateOrUpdate. */ +public final class VirtualmachinesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutVirtualMachine.json + */ + /** + * Sample code: PutVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualmachinesOperations() + .define("test-vm") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new VirtualmachinesExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withHardwareProfile(new VirtualmachinesPropertiesHardwareProfile().withVmSize("Default")) + .withNetworkProfile( + new VirtualmachinesPropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem().withId("test-nic")))) + .withOsProfile( + new VirtualmachinesPropertiesOsProfile() + .withAdminPassword("password") + .withAdminUsername("localadmin") + .withComputerName("luamaster")) + .withStorageProfile( + new VirtualmachinesPropertiesStorageProfile() + .withImageReference( + new VirtualmachinesPropertiesStorageProfileImageReference().withName("test-gallery-image"))) + .create(); + } +} +``` + +### VirtualmachinesOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation Delete. */ +public final class VirtualmachinesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteVirtualMachine.json + */ + /** + * Sample code: DeleteVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().deleteWithResponse("test-rg", "test-vm", Context.NONE); + } +} +``` + +### VirtualmachinesOperation_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation GetByResourceGroup. */ +public final class VirtualmachinesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetVirtualMachine.json + */ + /** + * Sample code: GetVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().getByResourceGroupWithResponse("test-rg", "test-vm", Context.NONE); + } +} +``` + +### VirtualmachinesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation List. */ +public final class VirtualmachinesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualMachineBySubscription.json + */ + /** + * Sample code: ListVirtualMachineBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualMachineBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().list(Context.NONE); + } +} +``` + +### VirtualmachinesOperation_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation ListByResourceGroup. */ +public final class VirtualmachinesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualMachineByResourceGroup.json + */ + /** + * Sample code: ListVirtualMachineByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualMachineByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().listByResourceGroup("test-rg", Context.NONE); + } +} +``` + +### VirtualmachinesOperation_Restart + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation Restart. */ +public final class VirtualmachinesOperationRestartSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/RestartVirtualMachine.json + */ + /** + * Sample code: RestartVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void restartVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().restart("test-rg", "test-vm", Context.NONE); + } +} +``` + +### VirtualmachinesOperation_Start + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation Start. */ +public final class VirtualmachinesOperationStartSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/StartVirtualMachine.json + */ + /** + * Sample code: StartVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void startVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().start("test-rg", "test-vm", Context.NONE); + } +} +``` + +### VirtualmachinesOperation_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation Stop. */ +public final class VirtualmachinesOperationStopSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/StopVirtualMachine.json + */ + /** + * Sample code: StopVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void stopVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().stop("test-rg", "test-vm", Context.NONE); + } +} +``` + +### VirtualmachinesOperation_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Virtualmachines; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualmachinesOperation Update. */ +public final class VirtualmachinesOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateVirtualMachine.json + */ + /** + * Sample code: UpdateVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Virtualmachines resource = + manager + .virtualmachinesOperations() + .getByResourceGroupWithResponse("test-rg", "test-vm", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; + } +} +``` + +### VirtualnetworksOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksExtendedLocation; + +/** Samples for VirtualnetworksOperation CreateOrUpdate. */ +public final class VirtualnetworksOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutVirtualNetwork.json + */ + /** + * Sample code: PutVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualnetworksOperations() + .define("test-vnet") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new VirtualnetworksExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withNetworkType("Transparent") + .create(); + } +} +``` + +### VirtualnetworksOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualnetworksOperation Delete. */ +public final class VirtualnetworksOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteVirtualNetwork.json + */ + /** + * Sample code: DeleteVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualnetworksOperations().deleteWithResponse("test-rg", "test-vnet", Context.NONE); + } +} +``` + +### VirtualnetworksOperation_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualnetworksOperation GetByResourceGroup. */ +public final class VirtualnetworksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetVirtualNetwork.json + */ + /** + * Sample code: GetVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualnetworksOperations().getByResourceGroupWithResponse("test-rg", "test-vnet", Context.NONE); + } +} +``` + +### VirtualnetworksOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualnetworksOperation List. */ +public final class VirtualnetworksOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualNetworkBySubscription.json + */ + /** + * Sample code: ListVirtualNetworkBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualNetworkBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualnetworksOperations().list(Context.NONE); + } +} +``` + +### VirtualnetworksOperation_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualnetworksOperation ListByResourceGroup. */ +public final class VirtualnetworksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualNetworkByResourceGroup.json + */ + /** + * Sample code: ListVirtualNetworkByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualNetworkByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualnetworksOperations().listByResourceGroup("test-rg", Context.NONE); + } +} +``` + +### VirtualnetworksOperation_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Virtualnetworks; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualnetworksOperation Update. */ +public final class VirtualnetworksOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateVirtualNetwork.json + */ + /** + * Sample code: UpdateVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Virtualnetworks resource = + manager + .virtualnetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vnet", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml index 7ead6ca264d40..071082c0a5b6b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/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-azurestackhci - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-azurestackhci + 1.0.0-beta.2 + jar - Microsoft Azure SDK for AzureStackHci Management - This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2020-10. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for AzureStackHci Management + This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-preview-2021-07. + 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.26.0 - - - com.azure - azure-core-management - 1.5.3 - - + + 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.26.0 + + + com.azure + azure-core-management + 1.5.3 + + diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java index 3e48e353084b4..6b14aa840a91f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,26 +17,48 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; import com.azure.resourcemanager.azurestackhci.implementation.AzureStackHciClientBuilder; -import com.azure.resourcemanager.azurestackhci.implementation.ClustersImpl; +import com.azure.resourcemanager.azurestackhci.implementation.GalleryimagesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.NetworkinterfacesOperationsImpl; import com.azure.resourcemanager.azurestackhci.implementation.OperationsImpl; -import com.azure.resourcemanager.azurestackhci.models.Clusters; +import com.azure.resourcemanager.azurestackhci.implementation.StoragecontainersOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.VirtualharddisksOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.VirtualmachinesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.VirtualnetworksOperationsImpl; +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesOperations; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesOperations; import com.azure.resourcemanager.azurestackhci.models.Operations; +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersOperations; +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksOperations; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesOperations; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksOperations; 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 AzureStackHciManager. Azure Stack HCI management service. */ public final class AzureStackHciManager { - private Operations operations; + private GalleryimagesOperations galleryimagesOperations; + + private NetworkinterfacesOperations networkinterfacesOperations; + + private StoragecontainersOperations storagecontainersOperations; + + private VirtualharddisksOperations virtualharddisksOperations; + + private VirtualmachinesOperations virtualmachinesOperations; - private Clusters clusters; + private VirtualnetworksOperations virtualnetworksOperations; + + private Operations operations; private final AzureStackHciClient clientObject; @@ -76,11 +98,12 @@ 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 Duration defaultPollInterval; @@ -120,6 +143,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. * @@ -138,9 +172,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; } @@ -176,20 +212,33 @@ public AzureStackHciManager 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); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -201,6 +250,60 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil } } + /** @return Resource collection API of GalleryimagesOperations. */ + public GalleryimagesOperations galleryimagesOperations() { + if (this.galleryimagesOperations == null) { + this.galleryimagesOperations = + new GalleryimagesOperationsImpl(clientObject.getGalleryimagesOperations(), this); + } + return galleryimagesOperations; + } + + /** @return Resource collection API of NetworkinterfacesOperations. */ + public NetworkinterfacesOperations networkinterfacesOperations() { + if (this.networkinterfacesOperations == null) { + this.networkinterfacesOperations = + new NetworkinterfacesOperationsImpl(clientObject.getNetworkinterfacesOperations(), this); + } + return networkinterfacesOperations; + } + + /** @return Resource collection API of StoragecontainersOperations. */ + public StoragecontainersOperations storagecontainersOperations() { + if (this.storagecontainersOperations == null) { + this.storagecontainersOperations = + new StoragecontainersOperationsImpl(clientObject.getStoragecontainersOperations(), this); + } + return storagecontainersOperations; + } + + /** @return Resource collection API of VirtualharddisksOperations. */ + public VirtualharddisksOperations virtualharddisksOperations() { + if (this.virtualharddisksOperations == null) { + this.virtualharddisksOperations = + new VirtualharddisksOperationsImpl(clientObject.getVirtualharddisksOperations(), this); + } + return virtualharddisksOperations; + } + + /** @return Resource collection API of VirtualmachinesOperations. */ + public VirtualmachinesOperations virtualmachinesOperations() { + if (this.virtualmachinesOperations == null) { + this.virtualmachinesOperations = + new VirtualmachinesOperationsImpl(clientObject.getVirtualmachinesOperations(), this); + } + return virtualmachinesOperations; + } + + /** @return Resource collection API of VirtualnetworksOperations. */ + public VirtualnetworksOperations virtualnetworksOperations() { + if (this.virtualnetworksOperations == null) { + this.virtualnetworksOperations = + new VirtualnetworksOperationsImpl(clientObject.getVirtualnetworksOperations(), this); + } + return virtualnetworksOperations; + } + /** @return Resource collection API of Operations. */ public Operations operations() { if (this.operations == null) { @@ -209,14 +312,6 @@ public Operations operations() { return operations; } - /** @return Resource collection API of Clusters. */ - public Clusters clusters() { - if (this.clusters == null) { - this.clusters = new ClustersImpl(clientObject.getClusters(), this); - } - return clusters; - } - /** * @return Wrapped service client AzureStackHciClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java index 277e14ea65dbb..77cbcc19a2aae 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java @@ -45,16 +45,51 @@ public interface AzureStackHciClient { Duration getDefaultPollInterval(); /** - * Gets the OperationsClient object to access its operations. + * Gets the GalleryimagesOperationsClient object to access its operations. * - * @return the OperationsClient object. + * @return the GalleryimagesOperationsClient object. */ - OperationsClient getOperations(); + GalleryimagesOperationsClient getGalleryimagesOperations(); + + /** + * Gets the NetworkinterfacesOperationsClient object to access its operations. + * + * @return the NetworkinterfacesOperationsClient object. + */ + NetworkinterfacesOperationsClient getNetworkinterfacesOperations(); + + /** + * Gets the StoragecontainersOperationsClient object to access its operations. + * + * @return the StoragecontainersOperationsClient object. + */ + StoragecontainersOperationsClient getStoragecontainersOperations(); + + /** + * Gets the VirtualharddisksOperationsClient object to access its operations. + * + * @return the VirtualharddisksOperationsClient object. + */ + VirtualharddisksOperationsClient getVirtualharddisksOperations(); /** - * Gets the ClustersClient object to access its operations. + * Gets the VirtualmachinesOperationsClient object to access its operations. * - * @return the ClustersClient object. + * @return the VirtualmachinesOperationsClient object. */ - ClustersClient getClusters(); + VirtualmachinesOperationsClient getVirtualmachinesOperations(); + + /** + * Gets the VirtualnetworksOperationsClient object to access its operations. + * + * @return the VirtualnetworksOperationsClient object. + */ + VirtualnetworksOperationsClient getVirtualnetworksOperations(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GalleryimagesOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GalleryimagesOperationsClient.java new file mode 100644 index 0000000000000..3cea558e92768 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/GalleryimagesOperationsClient.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryimagesInner; +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesPatch; + +/** An instance of this class provides access to all the operations defined in GalleryimagesOperationsClient. */ +public interface GalleryimagesOperationsClient { + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryimagesInner getByResourceGroup(String resourceGroupName, String galleryimagesName); + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @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 galleryimages resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryimagesName, Context context); + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryimagesInner> beginCreateOrUpdate( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages); + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryimagesInner> beginCreateOrUpdate( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages, Context context); + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryimagesInner createOrUpdate( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages); + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryimagesInner createOrUpdate( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages, Context context); + + /** + * Delete a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String galleryimagesName); + + /** + * Delete a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String galleryimagesName, Context context); + + /** + * Update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryimagesInner update(String resourceGroupName, String galleryimagesName, GalleryimagesPatch galleryimages); + + /** + * Update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String galleryimagesName, GalleryimagesPatch galleryimages, Context context); + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List all galleryimages under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all galleryimages under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/NetworkinterfacesOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/NetworkinterfacesOperationsClient.java new file mode 100644 index 0000000000000..2610865606f08 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/NetworkinterfacesOperationsClient.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkinterfacesInner; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesPatch; + +/** An instance of this class provides access to all the operations defined in NetworkinterfacesOperationsClient. */ +public interface NetworkinterfacesOperationsClient { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkinterfacesInner getByResourceGroup(String resourceGroupName, String networkinterfacesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @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 networkinterfaces resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkinterfacesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkinterfacesInner> beginCreateOrUpdate( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesInner networkinterfaces); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkinterfacesInner> beginCreateOrUpdate( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesInner networkinterfaces, + Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkinterfacesInner createOrUpdate( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesInner networkinterfaces); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkinterfacesInner createOrUpdate( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesInner networkinterfaces, + Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String networkinterfacesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String networkinterfacesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkinterfacesInner update( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesPatch networkinterfaces); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesPatch networkinterfaces, + Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java index 6a1af013a2fbc..0b8e907abe681 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java @@ -8,7 +8,7 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { @@ -17,10 +17,10 @@ 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 available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - AvailableOperationsInner list(); + OperationListResultInner list(); /** * List all available Microsoft.AzureStackHCI provider operations. @@ -29,8 +29,8 @@ 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 available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + Response listWithResponse(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/StoragecontainersOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/StoragecontainersOperationsClient.java new file mode 100644 index 0000000000000..fd1d158cf3b04 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/StoragecontainersOperationsClient.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.StoragecontainersInner; +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersPatch; + +/** An instance of this class provides access to all the operations defined in StoragecontainersOperationsClient. */ +public interface StoragecontainersOperationsClient { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StoragecontainersInner getByResourceGroup(String resourceGroupName, String storagecontainersName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @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 storagecontainers resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String storagecontainersName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StoragecontainersInner> beginCreateOrUpdate( + String resourceGroupName, String storagecontainersName, StoragecontainersInner storagecontainers); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StoragecontainersInner> beginCreateOrUpdate( + String resourceGroupName, + String storagecontainersName, + StoragecontainersInner storagecontainers, + Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StoragecontainersInner createOrUpdate( + String resourceGroupName, String storagecontainersName, StoragecontainersInner storagecontainers); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StoragecontainersInner createOrUpdate( + String resourceGroupName, + String storagecontainersName, + StoragecontainersInner storagecontainers, + Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String storagecontainersName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String storagecontainersName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StoragecontainersInner update( + String resourceGroupName, String storagecontainersName, StoragecontainersPatch storagecontainers); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String storagecontainersName, + StoragecontainersPatch storagecontainers, + Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualharddisksOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualharddisksOperationsClient.java new file mode 100644 index 0000000000000..c5cbba1a7e149 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualharddisksOperationsClient.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualharddisksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksPatch; + +/** An instance of this class provides access to all the operations defined in VirtualharddisksOperationsClient. */ +public interface VirtualharddisksOperationsClient { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualharddisksInner getByResourceGroup(String resourceGroupName, String virtualharddisksName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @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 virtualharddisks resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualharddisksName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualharddisksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualharddisksName, VirtualharddisksInner virtualharddisks); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualharddisksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualharddisksName, VirtualharddisksInner virtualharddisks, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualharddisksInner createOrUpdate( + String resourceGroupName, String virtualharddisksName, VirtualharddisksInner virtualharddisks); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualharddisksInner createOrUpdate( + String resourceGroupName, String virtualharddisksName, VirtualharddisksInner virtualharddisks, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualharddisksName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String virtualharddisksName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualharddisksInner update( + String resourceGroupName, String virtualharddisksName, VirtualharddisksPatch virtualharddisks); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String virtualharddisksName, VirtualharddisksPatch virtualharddisks, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualmachinesOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualmachinesOperationsClient.java new file mode 100644 index 0000000000000..eac9436995e06 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualmachinesOperationsClient.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualmachinesInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPatch; + +/** An instance of this class provides access to all the operations defined in VirtualmachinesOperationsClient. */ +public interface VirtualmachinesOperationsClient { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualmachinesInner getByResourceGroup(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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 virtualmachines resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualmachinesInner> beginCreateOrUpdate( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualmachinesInner> beginCreateOrUpdate( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualmachinesInner createOrUpdate( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualmachinesInner createOrUpdate( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualmachinesInner update( + String resourceGroupName, String virtualmachinesName, VirtualmachinesPatch virtualmachines); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String virtualmachinesName, VirtualmachinesPatch virtualmachines, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStart(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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> beginStart( + String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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 start(String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStop(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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> beginStop(String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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 stop(String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRestart(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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> beginRestart( + String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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 restart(String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualnetworksOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualnetworksOperationsClient.java new file mode 100644 index 0000000000000..f1e76080ea175 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/VirtualnetworksOperationsClient.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualnetworksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksPatch; + +/** An instance of this class provides access to all the operations defined in VirtualnetworksOperationsClient. */ +public interface VirtualnetworksOperationsClient { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualnetworks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualnetworksInner getByResourceGroup(String resourceGroupName, String virtualnetworksName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @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 virtualnetworks resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualnetworksName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualnetworks resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualnetworksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualnetworks resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualnetworksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualnetworks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualnetworksInner createOrUpdate( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualnetworks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualnetworksInner createOrUpdate( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualnetworksName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String virtualnetworksName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualnetworks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualnetworksInner update( + String resourceGroupName, String virtualnetworksName, VirtualnetworksPatch virtualnetworks); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualnetworks resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String virtualnetworksName, VirtualnetworksPatch virtualnetworks, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/AvailableOperationsInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/AvailableOperationsInner.java deleted file mode 100644 index f3536ea73c011..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/AvailableOperationsInner.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.azurestackhci.models.OperationDetail; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Available operations of the service. */ -@Fluent -public final class AvailableOperationsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableOperationsInner.class); - - /* - * Collection of available operation details - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Collection of available operation details. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of available operation details. - * - * @param value the value value to set. - * @return the AvailableOperationsInner object itself. - */ - public AvailableOperationsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for - * now, added for future use. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for - * now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the AvailableOperationsInner object itself. - */ - public AvailableOperationsInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java deleted file mode 100644 index 30f5fcebff66e..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; -import com.azure.resourcemanager.azurestackhci.models.CreatedByType; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.Status; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Cluster details. */ -@JsonFlatten -@Fluent -public class ClusterInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); - - /* - * Provisioning state. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Status of the cluster agent. - */ - @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private Status status; - - /* - * Unique, immutable resource id. - */ - @JsonProperty(value = "properties.cloudId", access = JsonProperty.Access.WRITE_ONLY) - private String cloudId; - - /* - * App id of cluster AAD identity. - */ - @JsonProperty(value = "properties.aadClientId") - private String aadClientId; - - /* - * Tenant id of cluster AAD identity. - */ - @JsonProperty(value = "properties.aadTenantId") - private String aadTenantId; - - /* - * Properties reported by cluster agent. - */ - @JsonProperty(value = "properties.reportedProperties") - private ClusterReportedProperties reportedProperties; - - /* - * Number of days remaining in the trial period. - */ - @JsonProperty(value = "properties.trialDaysRemaining", access = JsonProperty.Access.WRITE_ONLY) - private Float trialDaysRemaining; - - /* - * Type of billing applied to the resource. - */ - @JsonProperty(value = "properties.billingModel", access = JsonProperty.Access.WRITE_ONLY) - private String billingModel; - - /* - * First cluster sync timestamp. - */ - @JsonProperty(value = "properties.registrationTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime registrationTimestamp; - - /* - * Most recent cluster sync timestamp. - */ - @JsonProperty(value = "properties.lastSyncTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastSyncTimestamp; - - /* - * Most recent billing meter timestamp. - */ - @JsonProperty(value = "properties.lastBillingTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastBillingTimestamp; - - /* - * The identity that created the resource. - */ - @JsonProperty(value = "systemData.createdBy") - private String createdBy; - - /* - * The type of identity that created the resource. - */ - @JsonProperty(value = "systemData.createdByType") - private CreatedByType createdByType; - - /* - * The timestamp of resource creation (UTC). - */ - @JsonProperty(value = "systemData.createdAt") - private OffsetDateTime createdAt; - - /* - * The identity that last modified the resource. - */ - @JsonProperty(value = "systemData.lastModifiedBy") - private String lastModifiedBy; - - /* - * The type of identity that last modified the resource. - */ - @JsonProperty(value = "systemData.lastModifiedByType") - private CreatedByType lastModifiedByType; - - /* - * The timestamp of resource last modification (UTC) - */ - @JsonProperty(value = "systemData.lastModifiedAt") - private OffsetDateTime lastModifiedAt; - - /** - * Get the provisioningState property: Provisioning state. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the status property: Status of the cluster agent. - * - * @return the status value. - */ - public Status status() { - return this.status; - } - - /** - * Get the cloudId property: Unique, immutable resource id. - * - * @return the cloudId value. - */ - public String cloudId() { - return this.cloudId; - } - - /** - * Get the aadClientId property: App id of cluster AAD identity. - * - * @return the aadClientId value. - */ - public String aadClientId() { - return this.aadClientId; - } - - /** - * Set the aadClientId property: App id of cluster AAD identity. - * - * @param aadClientId the aadClientId value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withAadClientId(String aadClientId) { - this.aadClientId = aadClientId; - return this; - } - - /** - * Get the aadTenantId property: Tenant id of cluster AAD identity. - * - * @return the aadTenantId value. - */ - public String aadTenantId() { - return this.aadTenantId; - } - - /** - * Set the aadTenantId property: Tenant id of cluster AAD identity. - * - * @param aadTenantId the aadTenantId value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withAadTenantId(String aadTenantId) { - this.aadTenantId = aadTenantId; - return this; - } - - /** - * Get the reportedProperties property: Properties reported by cluster agent. - * - * @return the reportedProperties value. - */ - public ClusterReportedProperties reportedProperties() { - return this.reportedProperties; - } - - /** - * Set the reportedProperties property: Properties reported by cluster agent. - * - * @param reportedProperties the reportedProperties value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withReportedProperties(ClusterReportedProperties reportedProperties) { - this.reportedProperties = reportedProperties; - return this; - } - - /** - * Get the trialDaysRemaining property: Number of days remaining in the trial period. - * - * @return the trialDaysRemaining value. - */ - public Float trialDaysRemaining() { - return this.trialDaysRemaining; - } - - /** - * Get the billingModel property: Type of billing applied to the resource. - * - * @return the billingModel value. - */ - public String billingModel() { - return this.billingModel; - } - - /** - * Get the registrationTimestamp property: First cluster sync timestamp. - * - * @return the registrationTimestamp value. - */ - public OffsetDateTime registrationTimestamp() { - return this.registrationTimestamp; - } - - /** - * Get the lastSyncTimestamp property: Most recent cluster sync timestamp. - * - * @return the lastSyncTimestamp value. - */ - public OffsetDateTime lastSyncTimestamp() { - return this.lastSyncTimestamp; - } - - /** - * Get the lastBillingTimestamp property: Most recent billing meter timestamp. - * - * @return the lastBillingTimestamp value. - */ - public OffsetDateTime lastBillingTimestamp() { - return this.lastBillingTimestamp; - } - - /** - * Get the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - public String createdBy() { - return this.createdBy; - } - - /** - * Set the createdBy property: The identity that created the resource. - * - * @param createdBy the createdBy value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withCreatedBy(String createdBy) { - this.createdBy = createdBy; - return this; - } - - /** - * Get the createdByType property: The type of identity that created the resource. - * - * @return the createdByType value. - */ - public CreatedByType createdByType() { - return this.createdByType; - } - - /** - * Set the createdByType property: The type of identity that created the resource. - * - * @param createdByType the createdByType value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withCreatedByType(CreatedByType createdByType) { - this.createdByType = createdByType; - return this; - } - - /** - * Get the createdAt property: The timestamp of resource creation (UTC). - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: The timestamp of resource creation (UTC). - * - * @param createdAt the createdAt value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get the lastModifiedBy property: The identity that last modified the resource. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Set the lastModifiedBy property: The identity that last modified the resource. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; - } - - /** - * Get the lastModifiedByType property: The type of identity that last modified the resource. - * - * @return the lastModifiedByType value. - */ - public CreatedByType lastModifiedByType() { - return this.lastModifiedByType; - } - - /** - * Set the lastModifiedByType property: The type of identity that last modified the resource. - * - * @param lastModifiedByType the lastModifiedByType value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withLastModifiedByType(CreatedByType lastModifiedByType) { - this.lastModifiedByType = lastModifiedByType; - return this; - } - - /** - * Get the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @return the lastModifiedAt value. - */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; - } - - /** - * Set the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @param lastModifiedAt the lastModifiedAt value to set. - * @return the ClusterInner object itself. - */ - public ClusterInner withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.lastModifiedAt = lastModifiedAt; - return this; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (reportedProperties() != null) { - reportedProperties().validate(); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties.java new file mode 100644 index 0000000000000..f018b043caeca --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties.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.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksPropertiesSubnetsPropertiesItemsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RouteTablePropertiesFormat route Table resource. */ +@Fluent +public final +class ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties { + /* + * Routes - Collection of routes contained within a route table. + */ + @JsonProperty(value = "routes") + private List routes; + + /** + * Get the routes property: Routes - Collection of routes contained within a route table. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: Routes - Collection of routes contained within a route table. + * + * @param routes the routes value to set. + * @return the ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties + * object itself. + */ + public ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties + withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryimagesInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryimagesInner.java new file mode 100644 index 0000000000000..fe71092b9efcc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryimagesInner.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The galleryimages resource definition. */ +@Fluent +public final class GalleryimagesInner extends Resource { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private GalleryimagesProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private GalleryimagesExtendedLocation extendedLocation; + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private GalleryimagesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public GalleryimagesExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the GalleryimagesInner object itself. + */ + public GalleryimagesInner withExtendedLocation(GalleryimagesExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryimagesInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryimagesInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the containerName property: Container Name for storage container. + * + * @return the containerName value. + */ + public String containerName() { + return this.innerProperties() == null ? null : this.innerProperties().containerName(); + } + + /** + * Set the containerName property: Container Name for storage container. + * + * @param containerName the containerName value to set. + * @return the GalleryimagesInner object itself. + */ + public GalleryimagesInner withContainerName(String containerName) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryimagesProperties(); + } + this.innerProperties().withContainerName(containerName); + return this; + } + + /** + * Get the imagePath property: location of the image the gallery image should be created from. + * + * @return the imagePath value. + */ + public String imagePath() { + return this.innerProperties() == null ? null : this.innerProperties().imagePath(); + } + + /** + * Set the imagePath property: location of the image the gallery image should be created from. + * + * @param imagePath the imagePath value to set. + * @return the GalleryimagesInner object itself. + */ + public GalleryimagesInner withImagePath(String imagePath) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryimagesProperties(); + } + this.innerProperties().withImagePath(imagePath); + return this; + } + + /** + * Get the osType property: operating system type that the gallery image uses. Expected to be linux or windows. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: operating system type that the gallery image uses. Expected to be linux or windows. + * + * @param osType the osType value to set. + * @return the GalleryimagesInner object itself. + */ + public GalleryimagesInner withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryimagesProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the gallery image. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: Provisioning state of the gallery image. + * + * @param provisioningState the provisioningState value to set. + * @return the GalleryimagesInner object itself. + */ + public GalleryimagesInner withProvisioningState(String provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryimagesProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.innerProperties() == null ? null : this.innerProperties().resourceName(); + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the GalleryimagesInner object itself. + */ + public GalleryimagesInner withResourceName(String resourceName) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryimagesProperties(); + } + this.innerProperties().withResourceName(resourceName); + return this; + } + + /** + * Get the status property: MOCGalleryImageStatus defines the observed state of MOCGalleryImage. + * + * @return the status value. + */ + public Object status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: MOCGalleryImageStatus defines the observed state of MOCGalleryImage. + * + * @param status the status value to set. + * @return the GalleryimagesInner object itself. + */ + public GalleryimagesInner withStatus(Object status) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryimagesProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryimagesProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryimagesProperties.java new file mode 100644 index 0000000000000..2732c8e3d7db2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/GalleryimagesProperties.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The GalleryimagesProperties model. */ +@Fluent +public final class GalleryimagesProperties { + /* + * Container Name for storage container + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * location of the image the gallery image should be created from + */ + @JsonProperty(value = "imagePath") + private String imagePath; + + /* + * operating system type that the gallery image uses. Expected to be linux + * or windows + */ + @JsonProperty(value = "osType") + private OperatingSystemTypes osType; + + /* + * Provisioning state of the gallery image. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /* + * name of the object to be used in moc + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * MOCGalleryImageStatus defines the observed state of MOCGalleryImage + */ + @JsonProperty(value = "status") + private Object status; + + /** + * Get the containerName property: Container Name for storage container. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Container Name for storage container. + * + * @param containerName the containerName value to set. + * @return the GalleryimagesProperties object itself. + */ + public GalleryimagesProperties withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the imagePath property: location of the image the gallery image should be created from. + * + * @return the imagePath value. + */ + public String imagePath() { + return this.imagePath; + } + + /** + * Set the imagePath property: location of the image the gallery image should be created from. + * + * @param imagePath the imagePath value to set. + * @return the GalleryimagesProperties object itself. + */ + public GalleryimagesProperties withImagePath(String imagePath) { + this.imagePath = imagePath; + return this; + } + + /** + * Get the osType property: operating system type that the gallery image uses. Expected to be linux or windows. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: operating system type that the gallery image uses. Expected to be linux or windows. + * + * @param osType the osType value to set. + * @return the GalleryimagesProperties object itself. + */ + public GalleryimagesProperties withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the gallery image. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the gallery image. + * + * @param provisioningState the provisioningState value to set. + * @return the GalleryimagesProperties object itself. + */ + public GalleryimagesProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the GalleryimagesProperties object itself. + */ + public GalleryimagesProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the status property: MOCGalleryImageStatus defines the observed state of MOCGalleryImage. + * + * @return the status value. + */ + public Object status() { + return this.status; + } + + /** + * Set the status property: MOCGalleryImageStatus defines the observed state of MOCGalleryImage. + * + * @param status the status value to set. + * @return the GalleryimagesProperties object itself. + */ + public GalleryimagesProperties withStatus(Object status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkinterfacesInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkinterfacesInner.java new file mode 100644 index 0000000000000..24ce6b3090123 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkinterfacesInner.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.InterfaceDnsSettings; +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesExtendedLocation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The networkinterfaces resource definition. */ +@Fluent +public final class NetworkinterfacesInner extends Resource { + /* + * MOCNetworkInterfaceSpec defines the desired state of MOCNetworkInterface + */ + @JsonProperty(value = "properties") + private NetworkinterfacesProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The extendedLocation property. + */ + @JsonProperty(value = "extendedLocation") + private NetworkinterfacesExtendedLocation extendedLocation; + + /** + * Get the innerProperties property: MOCNetworkInterfaceSpec defines the desired state of MOCNetworkInterface. + * + * @return the innerProperties value. + */ + private NetworkinterfacesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + public NetworkinterfacesExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation property. + * + * @param extendedLocation the extendedLocation value to set. + * @return the NetworkinterfacesInner object itself. + */ + public NetworkinterfacesInner withExtendedLocation(NetworkinterfacesExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkinterfacesInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkinterfacesInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); + } + + /** + * Set the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the NetworkinterfacesInner object itself. + */ + public NetworkinterfacesInner withIpConfigurations(List ipConfigurations) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkinterfacesProperties(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the macAddress property: MacAddress - The MAC address of the network interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.innerProperties() == null ? null : this.innerProperties().macAddress(); + } + + /** + * Set the macAddress property: MacAddress - The MAC address of the network interface. + * + * @param macAddress the macAddress value to set. + * @return the NetworkinterfacesInner object itself. + */ + public NetworkinterfacesInner withMacAddress(String macAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkinterfacesProperties(); + } + this.innerProperties().withMacAddress(macAddress); + return this; + } + + /** + * Get the dnsSettings property: DNS Settings for the interface. + * + * @return the dnsSettings value. + */ + public InterfaceDnsSettings dnsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); + } + + /** + * Set the dnsSettings property: DNS Settings for the interface. + * + * @param dnsSettings the dnsSettings value to set. + * @return the NetworkinterfacesInner object itself. + */ + public NetworkinterfacesInner withDnsSettings(InterfaceDnsSettings dnsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkinterfacesProperties(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the NetworkinterfacesInner object itself. + */ + public NetworkinterfacesInner withProvisioningState(String provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkinterfacesProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.innerProperties() == null ? null : this.innerProperties().resourceName(); + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the NetworkinterfacesInner object itself. + */ + public NetworkinterfacesInner withResourceName(String resourceName) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkinterfacesProperties(); + } + this.innerProperties().withResourceName(resourceName); + return this; + } + + /** + * Get the status property: MOCNetworkInterfaceStatus defines the observed state of MOCNetworkInterface. + * + * @return the status value. + */ + public Object status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: MOCNetworkInterfaceStatus defines the observed state of MOCNetworkInterface. + * + * @param status the status value to set. + * @return the NetworkinterfacesInner object itself. + */ + public NetworkinterfacesInner withStatus(Object status) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkinterfacesProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkinterfacesProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkinterfacesProperties.java new file mode 100644 index 0000000000000..68b3a831e48c2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/NetworkinterfacesProperties.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.InterfaceDnsSettings; +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** MOCNetworkInterfaceSpec defines the desired state of MOCNetworkInterface. */ +@Fluent +public final class NetworkinterfacesProperties { + /* + * IPConfigurations - A list of IPConfigurations of the network interface. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * MacAddress - The MAC address of the network interface. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /* + * DNS Settings for the interface + */ + @JsonProperty(value = "dnsSettings") + private InterfaceDnsSettings dnsSettings; + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /* + * name of the object to be used in moc + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * MOCNetworkInterfaceStatus defines the observed state of + * MOCNetworkInterface + */ + @JsonProperty(value = "status") + private Object status; + + /** + * Get the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the NetworkinterfacesProperties object itself. + */ + public NetworkinterfacesProperties withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the macAddress property: MacAddress - The MAC address of the network interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the macAddress property: MacAddress - The MAC address of the network interface. + * + * @param macAddress the macAddress value to set. + * @return the NetworkinterfacesProperties object itself. + */ + public NetworkinterfacesProperties withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get the dnsSettings property: DNS Settings for the interface. + * + * @return the dnsSettings value. + */ + public InterfaceDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: DNS Settings for the interface. + * + * @param dnsSettings the dnsSettings value to set. + * @return the NetworkinterfacesProperties object itself. + */ + public NetworkinterfacesProperties withDnsSettings(InterfaceDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the NetworkinterfacesProperties object itself. + */ + public NetworkinterfacesProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the NetworkinterfacesProperties object itself. + */ + public NetworkinterfacesProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the status property: MOCNetworkInterfaceStatus defines the observed state of MOCNetworkInterface. + * + * @return the status value. + */ + public Object status() { + return this.status; + } + + /** + * Set the status property: MOCNetworkInterfaceStatus defines the observed state of MOCNetworkInterface. + * + * @param status the status value to set. + * @return the NetworkinterfacesProperties object itself. + */ + public NetworkinterfacesProperties withStatus(Object status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java new file mode 100644 index 0000000000000..cd70af853a48e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurestackhci.models.Operation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResultInner { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StoragecontainersInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StoragecontainersInner.java new file mode 100644 index 0000000000000..0a9dcaa2473af --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StoragecontainersInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersExtendedLocation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The storagecontainers resource definition. */ +@Fluent +public final class StoragecontainersInner extends Resource { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private StoragecontainersProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The extendedLocation property. + */ + @JsonProperty(value = "extendedLocation") + private StoragecontainersExtendedLocation extendedLocation; + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private StoragecontainersProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + public StoragecontainersExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation property. + * + * @param extendedLocation the extendedLocation value to set. + * @return the StoragecontainersInner object itself. + */ + public StoragecontainersInner withExtendedLocation(StoragecontainersExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public StoragecontainersInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public StoragecontainersInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the path property: location of the image the gallery image should be created from. + * + * @return the path value. + */ + public String path() { + return this.innerProperties() == null ? null : this.innerProperties().path(); + } + + /** + * Set the path property: location of the image the gallery image should be created from. + * + * @param path the path value to set. + * @return the StoragecontainersInner object itself. + */ + public StoragecontainersInner withPath(String path) { + if (this.innerProperties() == null) { + this.innerProperties = new StoragecontainersProperties(); + } + this.innerProperties().withPath(path); + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the StoragecontainersInner object itself. + */ + public StoragecontainersInner withProvisioningState(String provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new StoragecontainersProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.innerProperties() == null ? null : this.innerProperties().resourceName(); + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the StoragecontainersInner object itself. + */ + public StoragecontainersInner withResourceName(String resourceName) { + if (this.innerProperties() == null) { + this.innerProperties = new StoragecontainersProperties(); + } + this.innerProperties().withResourceName(resourceName); + return this; + } + + /** + * Get the status property: MOCStorageContainerStatus defines the observed state of MOCStorageContainer. + * + * @return the status value. + */ + public Object status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: MOCStorageContainerStatus defines the observed state of MOCStorageContainer. + * + * @param status the status value to set. + * @return the StoragecontainersInner object itself. + */ + public StoragecontainersInner withStatus(Object status) { + if (this.innerProperties() == null) { + this.innerProperties = new StoragecontainersProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StoragecontainersProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StoragecontainersProperties.java new file mode 100644 index 0000000000000..8526405aa8aca --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/StoragecontainersProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StoragecontainersProperties model. */ +@Fluent +public final class StoragecontainersProperties { + /* + * location of the image the gallery image should be created from + */ + @JsonProperty(value = "path") + private String path; + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /* + * name of the object to be used in moc + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * MOCStorageContainerStatus defines the observed state of + * MOCStorageContainer + */ + @JsonProperty(value = "status") + private Object status; + + /** + * Get the path property: location of the image the gallery image should be created from. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: location of the image the gallery image should be created from. + * + * @param path the path value to set. + * @return the StoragecontainersProperties object itself. + */ + public StoragecontainersProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the StoragecontainersProperties object itself. + */ + public StoragecontainersProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the StoragecontainersProperties object itself. + */ + public StoragecontainersProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the status property: MOCStorageContainerStatus defines the observed state of MOCStorageContainer. + * + * @return the status value. + */ + public Object status() { + return this.status; + } + + /** + * Set the status property: MOCStorageContainerStatus defines the observed state of MOCStorageContainer. + * + * @param status the status value to set. + * @return the StoragecontainersProperties object itself. + */ + public StoragecontainersProperties withStatus(Object status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualharddisksInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualharddisksInner.java new file mode 100644 index 0000000000000..ef9e83513e115 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualharddisksInner.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksExtendedLocation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The virtualharddisks resource definition. */ +@Fluent +public final class VirtualharddisksInner extends Resource { + /* + * MOCVirtualHardDiskSpec defines the desired state of MOCVirtualHardDisk + */ + @JsonProperty(value = "properties") + private VirtualharddisksProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The extendedLocation property. + */ + @JsonProperty(value = "extendedLocation") + private VirtualharddisksExtendedLocation extendedLocation; + + /** + * Get the innerProperties property: MOCVirtualHardDiskSpec defines the desired state of MOCVirtualHardDisk. + * + * @return the innerProperties value. + */ + private VirtualharddisksProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + public VirtualharddisksExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation property. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualharddisksInner object itself. + */ + public VirtualharddisksInner withExtendedLocation(VirtualharddisksExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualharddisksInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualharddisksInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the blockSizeBytes property: The blockSizeBytes property. + * + * @return the blockSizeBytes value. + */ + public Integer blockSizeBytes() { + return this.innerProperties() == null ? null : this.innerProperties().blockSizeBytes(); + } + + /** + * Set the blockSizeBytes property: The blockSizeBytes property. + * + * @param blockSizeBytes the blockSizeBytes value to set. + * @return the VirtualharddisksInner object itself. + */ + public VirtualharddisksInner withBlockSizeBytes(Integer blockSizeBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualharddisksProperties(); + } + this.innerProperties().withBlockSizeBytes(blockSizeBytes); + return this; + } + + /** + * Get the diskSizeBytes property: diskSizeBytes - size of the disk in GB. + * + * @return the diskSizeBytes value. + */ + public Long diskSizeBytes() { + return this.innerProperties() == null ? null : this.innerProperties().diskSizeBytes(); + } + + /** + * Set the diskSizeBytes property: diskSizeBytes - size of the disk in GB. + * + * @param diskSizeBytes the diskSizeBytes value to set. + * @return the VirtualharddisksInner object itself. + */ + public VirtualharddisksInner withDiskSizeBytes(Long diskSizeBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualharddisksProperties(); + } + this.innerProperties().withDiskSizeBytes(diskSizeBytes); + return this; + } + + /** + * Get the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @return the dynamic value. + */ + public Boolean dynamic() { + return this.innerProperties() == null ? null : this.innerProperties().dynamic(); + } + + /** + * Set the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @param dynamic the dynamic value to set. + * @return the VirtualharddisksInner object itself. + */ + public VirtualharddisksInner withDynamic(Boolean dynamic) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualharddisksProperties(); + } + this.innerProperties().withDynamic(dynamic); + return this; + } + + /** + * Get the logicalSectorBytes property: The logicalSectorBytes property. + * + * @return the logicalSectorBytes value. + */ + public Integer logicalSectorBytes() { + return this.innerProperties() == null ? null : this.innerProperties().logicalSectorBytes(); + } + + /** + * Set the logicalSectorBytes property: The logicalSectorBytes property. + * + * @param logicalSectorBytes the logicalSectorBytes value to set. + * @return the VirtualharddisksInner object itself. + */ + public VirtualharddisksInner withLogicalSectorBytes(Integer logicalSectorBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualharddisksProperties(); + } + this.innerProperties().withLogicalSectorBytes(logicalSectorBytes); + return this; + } + + /** + * Get the physicalSectorBytes property: The physicalSectorBytes property. + * + * @return the physicalSectorBytes value. + */ + public Integer physicalSectorBytes() { + return this.innerProperties() == null ? null : this.innerProperties().physicalSectorBytes(); + } + + /** + * Set the physicalSectorBytes property: The physicalSectorBytes property. + * + * @param physicalSectorBytes the physicalSectorBytes value to set. + * @return the VirtualharddisksInner object itself. + */ + public VirtualharddisksInner withPhysicalSectorBytes(Integer physicalSectorBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualharddisksProperties(); + } + this.innerProperties().withPhysicalSectorBytes(physicalSectorBytes); + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the VirtualharddisksInner object itself. + */ + public VirtualharddisksInner withProvisioningState(String provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualharddisksProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.innerProperties() == null ? null : this.innerProperties().resourceName(); + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the VirtualharddisksInner object itself. + */ + public VirtualharddisksInner withResourceName(String resourceName) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualharddisksProperties(); + } + this.innerProperties().withResourceName(resourceName); + return this; + } + + /** + * Get the status property: MOCVirtualHardDiskStatus defines the observed state of MOCVirtualHardDisk. + * + * @return the status value. + */ + public Object status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: MOCVirtualHardDiskStatus defines the observed state of MOCVirtualHardDisk. + * + * @param status the status value to set. + * @return the VirtualharddisksInner object itself. + */ + public VirtualharddisksInner withStatus(Object status) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualharddisksProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualharddisksProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualharddisksProperties.java new file mode 100644 index 0000000000000..6bcc82fbe05f7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualharddisksProperties.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** MOCVirtualHardDiskSpec defines the desired state of MOCVirtualHardDisk. */ +@Fluent +public final class VirtualharddisksProperties { + /* + * The blockSizeBytes property. + */ + @JsonProperty(value = "blockSizeBytes") + private Integer blockSizeBytes; + + /* + * diskSizeBytes - size of the disk in GB + */ + @JsonProperty(value = "diskSizeBytes") + private Long diskSizeBytes; + + /* + * Boolean for enabling dynamic sizing on the virtual hard disk + */ + @JsonProperty(value = "dynamic") + private Boolean dynamic; + + /* + * The logicalSectorBytes property. + */ + @JsonProperty(value = "logicalSectorBytes") + private Integer logicalSectorBytes; + + /* + * The physicalSectorBytes property. + */ + @JsonProperty(value = "physicalSectorBytes") + private Integer physicalSectorBytes; + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /* + * name of the object to be used in moc + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * MOCVirtualHardDiskStatus defines the observed state of + * MOCVirtualHardDisk + */ + @JsonProperty(value = "status") + private Object status; + + /** + * Get the blockSizeBytes property: The blockSizeBytes property. + * + * @return the blockSizeBytes value. + */ + public Integer blockSizeBytes() { + return this.blockSizeBytes; + } + + /** + * Set the blockSizeBytes property: The blockSizeBytes property. + * + * @param blockSizeBytes the blockSizeBytes value to set. + * @return the VirtualharddisksProperties object itself. + */ + public VirtualharddisksProperties withBlockSizeBytes(Integer blockSizeBytes) { + this.blockSizeBytes = blockSizeBytes; + return this; + } + + /** + * Get the diskSizeBytes property: diskSizeBytes - size of the disk in GB. + * + * @return the diskSizeBytes value. + */ + public Long diskSizeBytes() { + return this.diskSizeBytes; + } + + /** + * Set the diskSizeBytes property: diskSizeBytes - size of the disk in GB. + * + * @param diskSizeBytes the diskSizeBytes value to set. + * @return the VirtualharddisksProperties object itself. + */ + public VirtualharddisksProperties withDiskSizeBytes(Long diskSizeBytes) { + this.diskSizeBytes = diskSizeBytes; + return this; + } + + /** + * Get the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @return the dynamic value. + */ + public Boolean dynamic() { + return this.dynamic; + } + + /** + * Set the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @param dynamic the dynamic value to set. + * @return the VirtualharddisksProperties object itself. + */ + public VirtualharddisksProperties withDynamic(Boolean dynamic) { + this.dynamic = dynamic; + return this; + } + + /** + * Get the logicalSectorBytes property: The logicalSectorBytes property. + * + * @return the logicalSectorBytes value. + */ + public Integer logicalSectorBytes() { + return this.logicalSectorBytes; + } + + /** + * Set the logicalSectorBytes property: The logicalSectorBytes property. + * + * @param logicalSectorBytes the logicalSectorBytes value to set. + * @return the VirtualharddisksProperties object itself. + */ + public VirtualharddisksProperties withLogicalSectorBytes(Integer logicalSectorBytes) { + this.logicalSectorBytes = logicalSectorBytes; + return this; + } + + /** + * Get the physicalSectorBytes property: The physicalSectorBytes property. + * + * @return the physicalSectorBytes value. + */ + public Integer physicalSectorBytes() { + return this.physicalSectorBytes; + } + + /** + * Set the physicalSectorBytes property: The physicalSectorBytes property. + * + * @param physicalSectorBytes the physicalSectorBytes value to set. + * @return the VirtualharddisksProperties object itself. + */ + public VirtualharddisksProperties withPhysicalSectorBytes(Integer physicalSectorBytes) { + this.physicalSectorBytes = physicalSectorBytes; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the VirtualharddisksProperties object itself. + */ + public VirtualharddisksProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the VirtualharddisksProperties object itself. + */ + public VirtualharddisksProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the status property: MOCVirtualHardDiskStatus defines the observed state of MOCVirtualHardDisk. + * + * @return the status value. + */ + public Object status() { + return this.status; + } + + /** + * Set the status property: MOCVirtualHardDiskStatus defines the observed state of MOCVirtualHardDisk. + * + * @param status the status value to set. + * @return the VirtualharddisksProperties object itself. + */ + public VirtualharddisksProperties withStatus(Object status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualmachinesInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualmachinesInner.java new file mode 100644 index 0000000000000..7f89011124f06 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualmachinesInner.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesSecurityProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesStorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The virtualmachines resource definition. */ +@Fluent +public final class VirtualmachinesInner extends Resource { + /* + * MOCVirtualMachineSpec defines the desired state of MOCVirtualMachine + */ + @JsonProperty(value = "properties") + private VirtualmachinesProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The extendedLocation property. + */ + @JsonProperty(value = "extendedLocation") + private VirtualmachinesExtendedLocation extendedLocation; + + /** + * Get the innerProperties property: MOCVirtualMachineSpec defines the desired state of MOCVirtualMachine. + * + * @return the innerProperties value. + */ + private VirtualmachinesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + public VirtualmachinesExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation property. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualmachinesInner object itself. + */ + public VirtualmachinesInner withExtendedLocation(VirtualmachinesExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualmachinesInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualmachinesInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public VirtualmachinesPropertiesHardwareProfile hardwareProfile() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); + } + + /** + * Set the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualmachinesInner object itself. + */ + public VirtualmachinesInner withHardwareProfile(VirtualmachinesPropertiesHardwareProfile hardwareProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualmachinesProperties(); + } + this.innerProperties().withHardwareProfile(hardwareProfile); + return this; + } + + /** + * Get the networkProfile property: NetworkProfile - describes the network configuration the virtual machine. + * + * @return the networkProfile value. + */ + public VirtualmachinesPropertiesNetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + + /** + * Set the networkProfile property: NetworkProfile - describes the network configuration the virtual machine. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualmachinesInner object itself. + */ + public VirtualmachinesInner withNetworkProfile(VirtualmachinesPropertiesNetworkProfile networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualmachinesProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); + return this; + } + + /** + * Get the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @return the osProfile value. + */ + public VirtualmachinesPropertiesOsProfile osProfile() { + return this.innerProperties() == null ? null : this.innerProperties().osProfile(); + } + + /** + * Set the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @param osProfile the osProfile value to set. + * @return the VirtualmachinesInner object itself. + */ + public VirtualmachinesInner withOsProfile(VirtualmachinesPropertiesOsProfile osProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualmachinesProperties(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.innerProperties() == null ? null : this.innerProperties().resourceName(); + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the VirtualmachinesInner object itself. + */ + public VirtualmachinesInner withResourceName(String resourceName) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualmachinesProperties(); + } + this.innerProperties().withResourceName(resourceName); + return this; + } + + /** + * Get the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine. + * + * @return the securityProfile value. + */ + public VirtualmachinesPropertiesSecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); + } + + /** + * Set the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualmachinesInner object itself. + */ + public VirtualmachinesInner withSecurityProfile(VirtualmachinesPropertiesSecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualmachinesProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine. + * + * @return the storageProfile value. + */ + public VirtualmachinesPropertiesStorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); + } + + /** + * Set the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualmachinesInner object itself. + */ + public VirtualmachinesInner withStorageProfile(VirtualmachinesPropertiesStorageProfile storageProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualmachinesProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the VirtualmachinesInner object itself. + */ + public VirtualmachinesInner withProvisioningState(String provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualmachinesProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the status property: MOCVirtualMachineStatus defines the observed state of MOCVirtualMachine. + * + * @return the status value. + */ + public Object status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: MOCVirtualMachineStatus defines the observed state of MOCVirtualMachine. + * + * @param status the status value to set. + * @return the VirtualmachinesInner object itself. + */ + public VirtualmachinesInner withStatus(Object status) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualmachinesProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualmachinesProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualmachinesProperties.java new file mode 100644 index 0000000000000..1d173cfaf6767 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualmachinesProperties.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesSecurityProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesStorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** MOCVirtualMachineSpec defines the desired state of MOCVirtualMachine. */ +@Fluent +public final class VirtualmachinesProperties { + /* + * HardwareProfile - Specifies the hardware settings for the virtual + * machine. + */ + @JsonProperty(value = "hardwareProfile") + private VirtualmachinesPropertiesHardwareProfile hardwareProfile; + + /* + * NetworkProfile - describes the network configuration the virtual machine + */ + @JsonProperty(value = "networkProfile") + private VirtualmachinesPropertiesNetworkProfile networkProfile; + + /* + * OsProfile - describes the configuration of the operating system and sets + * login data + */ + @JsonProperty(value = "osProfile") + private VirtualmachinesPropertiesOsProfile osProfile; + + /* + * name of the object to be used in moc + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * SecurityProfile - Specifies the security settings for the virtual + * machine. + */ + @JsonProperty(value = "securityProfile") + private VirtualmachinesPropertiesSecurityProfile securityProfile; + + /* + * StorageProfile - contains information about the disks and storage + * information for the virtual machine + */ + @JsonProperty(value = "storageProfile") + private VirtualmachinesPropertiesStorageProfile storageProfile; + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /* + * MOCVirtualMachineStatus defines the observed state of MOCVirtualMachine + */ + @JsonProperty(value = "status") + private Object status; + + /** + * Get the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public VirtualmachinesPropertiesHardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualmachinesProperties object itself. + */ + public VirtualmachinesProperties withHardwareProfile(VirtualmachinesPropertiesHardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the networkProfile property: NetworkProfile - describes the network configuration the virtual machine. + * + * @return the networkProfile value. + */ + public VirtualmachinesPropertiesNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: NetworkProfile - describes the network configuration the virtual machine. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualmachinesProperties object itself. + */ + public VirtualmachinesProperties withNetworkProfile(VirtualmachinesPropertiesNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @return the osProfile value. + */ + public VirtualmachinesPropertiesOsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @param osProfile the osProfile value to set. + * @return the VirtualmachinesProperties object itself. + */ + public VirtualmachinesProperties withOsProfile(VirtualmachinesPropertiesOsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the VirtualmachinesProperties object itself. + */ + public VirtualmachinesProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine. + * + * @return the securityProfile value. + */ + public VirtualmachinesPropertiesSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualmachinesProperties object itself. + */ + public VirtualmachinesProperties withSecurityProfile(VirtualmachinesPropertiesSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine. + * + * @return the storageProfile value. + */ + public VirtualmachinesPropertiesStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualmachinesProperties object itself. + */ + public VirtualmachinesProperties withStorageProfile(VirtualmachinesPropertiesStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the VirtualmachinesProperties object itself. + */ + public VirtualmachinesProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the status property: MOCVirtualMachineStatus defines the observed state of MOCVirtualMachine. + * + * @return the status value. + */ + public Object status() { + return this.status; + } + + /** + * Set the status property: MOCVirtualMachineStatus defines the observed state of MOCVirtualMachine. + * + * @param status the status value to set. + * @return the VirtualmachinesProperties object itself. + */ + public VirtualmachinesProperties withStatus(Object status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksInner.java new file mode 100644 index 0000000000000..fa5fb42e797b9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksInner.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksPropertiesSubnetsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The virtualnetworks resource definition. */ +@Fluent +public final class VirtualnetworksInner extends Resource { + /* + * MOCVirtualNetworkSpec defines the desired state of MOCVirtualNetwork + */ + @JsonProperty(value = "properties") + private VirtualnetworksProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The extendedLocation property. + */ + @JsonProperty(value = "extendedLocation") + private VirtualnetworksExtendedLocation extendedLocation; + + /** + * Get the innerProperties property: MOCVirtualNetworkSpec defines the desired state of MOCVirtualNetwork. + * + * @return the innerProperties value. + */ + private VirtualnetworksProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + public VirtualnetworksExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation property. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualnetworksInner object itself. + */ + public VirtualnetworksInner withExtendedLocation(VirtualnetworksExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualnetworksInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualnetworksInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the networkType property: Type of the network. + * + * @return the networkType value. + */ + public String networkType() { + return this.innerProperties() == null ? null : this.innerProperties().networkType(); + } + + /** + * Set the networkType property: Type of the network. + * + * @param networkType the networkType value to set. + * @return the VirtualnetworksInner object itself. + */ + public VirtualnetworksInner withNetworkType(String networkType) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksProperties(); + } + this.innerProperties().withNetworkType(networkType); + return this; + } + + /** + * Get the subnets property: Subnet - list of subnets under the virtual network. + * + * @return the subnets value. + */ + public List subnets() { + return this.innerProperties() == null ? null : this.innerProperties().subnets(); + } + + /** + * Set the subnets property: Subnet - list of subnets under the virtual network. + * + * @param subnets the subnets value to set. + * @return the VirtualnetworksInner object itself. + */ + public VirtualnetworksInner withSubnets(List subnets) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksProperties(); + } + this.innerProperties().withSubnets(subnets); + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the VirtualnetworksInner object itself. + */ + public VirtualnetworksInner withProvisioningState(String provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.innerProperties() == null ? null : this.innerProperties().resourceName(); + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the VirtualnetworksInner object itself. + */ + public VirtualnetworksInner withResourceName(String resourceName) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksProperties(); + } + this.innerProperties().withResourceName(resourceName); + return this; + } + + /** + * Get the status property: MOCVirtualNetworkStatus defines the observed state of MOCVirtualNetwork. + * + * @return the status value. + */ + public Object status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: MOCVirtualNetworkStatus defines the observed state of MOCVirtualNetwork. + * + * @param status the status value to set. + * @return the VirtualnetworksInner object itself. + */ + public VirtualnetworksInner withStatus(Object status) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksProperties.java new file mode 100644 index 0000000000000..924fef931c428 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksProperties.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksPropertiesSubnetsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** MOCVirtualNetworkSpec defines the desired state of MOCVirtualNetwork. */ +@Fluent +public final class VirtualnetworksProperties { + /* + * Type of the network + */ + @JsonProperty(value = "networkType") + private String networkType; + + /* + * Subnet - list of subnets under the virtual network + */ + @JsonProperty(value = "subnets") + private List subnets; + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /* + * name of the object to be used in moc + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * MOCVirtualNetworkStatus defines the observed state of MOCVirtualNetwork + */ + @JsonProperty(value = "status") + private Object status; + + /** + * Get the networkType property: Type of the network. + * + * @return the networkType value. + */ + public String networkType() { + return this.networkType; + } + + /** + * Set the networkType property: Type of the network. + * + * @param networkType the networkType value to set. + * @return the VirtualnetworksProperties object itself. + */ + public VirtualnetworksProperties withNetworkType(String networkType) { + this.networkType = networkType; + return this; + } + + /** + * Get the subnets property: Subnet - list of subnets under the virtual network. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: Subnet - list of subnets under the virtual network. + * + * @param subnets the subnets value to set. + * @return the VirtualnetworksProperties object itself. + */ + public VirtualnetworksProperties withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the VirtualnetworksProperties object itself. + */ + public VirtualnetworksProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: name of the object to be used in moc. + * + * @param resourceName the resourceName value to set. + * @return the VirtualnetworksProperties object itself. + */ + public VirtualnetworksProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the status property: MOCVirtualNetworkStatus defines the observed state of MOCVirtualNetwork. + * + * @return the status value. + */ + public Object status() { + return this.status; + } + + /** + * Set the status property: MOCVirtualNetworkStatus defines the observed state of MOCVirtualNetwork. + * + * @param status the status value to set. + * @return the VirtualnetworksProperties object itself. + */ + public VirtualnetworksProperties withStatus(Object status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnets() != null) { + subnets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksPropertiesSubnetsItemAutoGenerated.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksPropertiesSubnetsItemAutoGenerated.java new file mode 100644 index 0000000000000..41b347f2f9fdc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksPropertiesSubnetsItemAutoGenerated.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable; +import com.azure.resourcemanager.azurestackhci.models.ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems; +import com.azure.resourcemanager.azurestackhci.models.IpPool; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SubnetProperties - Properties of the subnet. */ +@Fluent +public final class VirtualnetworksPropertiesSubnetsItemAutoGenerated { + /* + * Cidr for this subnet - IPv4, IPv6 + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * AddressPrefixes - List of address prefixes for the subnet. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * IPAllocationMethod - The IP address allocation method. Possible values + * include: 'Static', 'Dynamic' + */ + @JsonProperty(value = "ipAllocationMethod") + private String ipAllocationMethod; + + /* + * IPConfigurationReferences - list of IPConfigurationReferences + */ + @JsonProperty(value = "ipConfigurationReferences") + private List< + ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems> + ipConfigurationReferences; + + /* + * RouteTable for the subnet + */ + @JsonProperty(value = "routeTable") + private ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable; + + /* + * network associated pool of IP Addresses + */ + @JsonProperty(value = "ipPools") + private List ipPools; + + /* + * Vlan to use for the subnet + */ + @JsonProperty(value = "vlan") + private Integer vlan; + + /** + * Get the addressPrefix property: Cidr for this subnet - IPv4, IPv6. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: Cidr for this subnet - IPv4, IPv6. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualnetworksPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualnetworksPropertiesSubnetsItemAutoGenerated withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the addressPrefixes property: AddressPrefixes - List of address prefixes for the subnet. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: AddressPrefixes - List of address prefixes for the subnet. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the VirtualnetworksPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualnetworksPropertiesSubnetsItemAutoGenerated withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values + * include: 'Static', 'Dynamic'. + * + * @return the ipAllocationMethod value. + */ + public String ipAllocationMethod() { + return this.ipAllocationMethod; + } + + /** + * Set the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values + * include: 'Static', 'Dynamic'. + * + * @param ipAllocationMethod the ipAllocationMethod value to set. + * @return the VirtualnetworksPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualnetworksPropertiesSubnetsItemAutoGenerated withIpAllocationMethod(String ipAllocationMethod) { + this.ipAllocationMethod = ipAllocationMethod; + return this; + } + + /** + * Get the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. + * + * @return the ipConfigurationReferences value. + */ + public List< + ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems> + ipConfigurationReferences() { + return this.ipConfigurationReferences; + } + + /** + * Set the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. + * + * @param ipConfigurationReferences the ipConfigurationReferences value to set. + * @return the VirtualnetworksPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualnetworksPropertiesSubnetsItemAutoGenerated withIpConfigurationReferences( + List< + ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems> + ipConfigurationReferences) { + this.ipConfigurationReferences = ipConfigurationReferences; + return this; + } + + /** + * Get the routeTable property: RouteTable for the subnet. + * + * @return the routeTable value. + */ + public ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable() { + return this.routeTable; + } + + /** + * Set the routeTable property: RouteTable for the subnet. + * + * @param routeTable the routeTable value to set. + * @return the VirtualnetworksPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualnetworksPropertiesSubnetsItemAutoGenerated withRouteTable( + ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable) { + this.routeTable = routeTable; + return this; + } + + /** + * Get the ipPools property: network associated pool of IP Addresses. + * + * @return the ipPools value. + */ + public List ipPools() { + return this.ipPools; + } + + /** + * Set the ipPools property: network associated pool of IP Addresses. + * + * @param ipPools the ipPools value to set. + * @return the VirtualnetworksPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualnetworksPropertiesSubnetsItemAutoGenerated withIpPools(List ipPools) { + this.ipPools = ipPools; + return this; + } + + /** + * Get the vlan property: Vlan to use for the subnet. + * + * @return the vlan value. + */ + public Integer vlan() { + return this.vlan; + } + + /** + * Set the vlan property: Vlan to use for the subnet. + * + * @param vlan the vlan value to set. + * @return the VirtualnetworksPropertiesSubnetsItemAutoGenerated object itself. + */ + public VirtualnetworksPropertiesSubnetsItemAutoGenerated withVlan(Integer vlan) { + this.vlan = vlan; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurationReferences() != null) { + ipConfigurationReferences().forEach(e -> e.validate()); + } + if (routeTable() != null) { + routeTable().validate(); + } + if (ipPools() != null) { + ipPools().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem.java new file mode 100644 index 0000000000000..565b9cc4c9f11 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem.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.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** RoutePropertiesFormat - Properties of the route. */ +@Fluent +public final class VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem { + /* + * AddressPrefix - The destination CIDR to which the route applies. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * NextHopIPAddress - The IP address packets should be forwarded to. Next + * hop values are only allowed in routes where the next hop type is + * VirtualAppliance. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * Get the addressPrefix property: AddressPrefix - The destination CIDR to which the route applies. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: AddressPrefix - The destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the nextHopIpAddress property: NextHopIPAddress - The IP address packets should be forwarded to. Next hop + * values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: NextHopIPAddress - The IP address packets should be forwarded to. Next hop + * values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java index c6f8b7d73b93d..5cba7fa522dbd 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java @@ -22,8 +22,13 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; -import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; +import com.azure.resourcemanager.azurestackhci.fluent.GalleryimagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.NetworkinterfacesOperationsClient; import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.StoragecontainersOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualharddisksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualmachinesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualnetworksOperationsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -37,8 +42,6 @@ /** Initializes a new instance of the AzureStackHciClientImpl type. */ @ServiceClient(builder = AzureStackHciClientBuilder.class) public final class AzureStackHciClientImpl implements AzureStackHciClient { - private final ClientLogger logger = new ClientLogger(AzureStackHciClientImpl.class); - /** The ID of the target subscription. */ private final String subscriptionId; @@ -111,28 +114,88 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The GalleryimagesOperationsClient object to access its operations. */ + private final GalleryimagesOperationsClient galleryimagesOperations; /** - * Gets the OperationsClient object to access its operations. + * Gets the GalleryimagesOperationsClient object to access its operations. * - * @return the OperationsClient object. + * @return the GalleryimagesOperationsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public GalleryimagesOperationsClient getGalleryimagesOperations() { + return this.galleryimagesOperations; + } + + /** The NetworkinterfacesOperationsClient object to access its operations. */ + private final NetworkinterfacesOperationsClient networkinterfacesOperations; + + /** + * Gets the NetworkinterfacesOperationsClient object to access its operations. + * + * @return the NetworkinterfacesOperationsClient object. + */ + public NetworkinterfacesOperationsClient getNetworkinterfacesOperations() { + return this.networkinterfacesOperations; + } + + /** The StoragecontainersOperationsClient object to access its operations. */ + private final StoragecontainersOperationsClient storagecontainersOperations; + + /** + * Gets the StoragecontainersOperationsClient object to access its operations. + * + * @return the StoragecontainersOperationsClient object. + */ + public StoragecontainersOperationsClient getStoragecontainersOperations() { + return this.storagecontainersOperations; + } + + /** The VirtualharddisksOperationsClient object to access its operations. */ + private final VirtualharddisksOperationsClient virtualharddisksOperations; + + /** + * Gets the VirtualharddisksOperationsClient object to access its operations. + * + * @return the VirtualharddisksOperationsClient object. + */ + public VirtualharddisksOperationsClient getVirtualharddisksOperations() { + return this.virtualharddisksOperations; + } + + /** The VirtualmachinesOperationsClient object to access its operations. */ + private final VirtualmachinesOperationsClient virtualmachinesOperations; + + /** + * Gets the VirtualmachinesOperationsClient object to access its operations. + * + * @return the VirtualmachinesOperationsClient object. + */ + public VirtualmachinesOperationsClient getVirtualmachinesOperations() { + return this.virtualmachinesOperations; + } + + /** The VirtualnetworksOperationsClient object to access its operations. */ + private final VirtualnetworksOperationsClient virtualnetworksOperations; + + /** + * Gets the VirtualnetworksOperationsClient object to access its operations. + * + * @return the VirtualnetworksOperationsClient object. + */ + public VirtualnetworksOperationsClient getVirtualnetworksOperations() { + return this.virtualnetworksOperations; } - /** The ClustersClient object to access its operations. */ - private final ClustersClient clusters; + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; /** - * Gets the ClustersClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the ClustersClient object. + * @return the OperationsClient object. */ - public ClustersClient getClusters() { - return this.clusters; + public OperationsClient getOperations() { + return this.operations; } /** @@ -157,9 +220,14 @@ public ClustersClient getClusters() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-10-01"; + this.apiVersion = "2021-07-01-preview"; + this.galleryimagesOperations = new GalleryimagesOperationsClientImpl(this); + this.networkinterfacesOperations = new NetworkinterfacesOperationsClientImpl(this); + this.storagecontainersOperations = new StoragecontainersOperationsClientImpl(this); + this.virtualharddisksOperations = new VirtualharddisksOperationsClientImpl(this); + this.virtualmachinesOperations = new VirtualmachinesOperationsClientImpl(this); + this.virtualnetworksOperations = new VirtualnetworksOperationsClientImpl(this); this.operations = new OperationsClientImpl(this); - this.clusters = new ClustersClientImpl(this); } /** @@ -245,7 +313,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -304,4 +372,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureStackHciClientImpl.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java deleted file mode 100644 index d42ade422ccf5..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.implementation; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; -import com.azure.resourcemanager.azurestackhci.models.ClusterUpdate; -import com.azure.resourcemanager.azurestackhci.models.CreatedByType; -import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; -import com.azure.resourcemanager.azurestackhci.models.Status; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; - -public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { - private ClusterInner innerObject; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public Status status() { - return this.innerModel().status(); - } - - public String cloudId() { - return this.innerModel().cloudId(); - } - - public String aadClientId() { - return this.innerModel().aadClientId(); - } - - public String aadTenantId() { - return this.innerModel().aadTenantId(); - } - - public ClusterReportedProperties reportedProperties() { - return this.innerModel().reportedProperties(); - } - - public Float trialDaysRemaining() { - return this.innerModel().trialDaysRemaining(); - } - - public String billingModel() { - return this.innerModel().billingModel(); - } - - public OffsetDateTime registrationTimestamp() { - return this.innerModel().registrationTimestamp(); - } - - public OffsetDateTime lastSyncTimestamp() { - return this.innerModel().lastSyncTimestamp(); - } - - public OffsetDateTime lastBillingTimestamp() { - return this.innerModel().lastBillingTimestamp(); - } - - public String createdBy() { - return this.innerModel().createdBy(); - } - - public CreatedByType createdByType() { - return this.innerModel().createdByType(); - } - - public OffsetDateTime createdAt() { - return this.innerModel().createdAt(); - } - - public String lastModifiedBy() { - return this.innerModel().lastModifiedBy(); - } - - public CreatedByType lastModifiedByType() { - return this.innerModel().lastModifiedByType(); - } - - public OffsetDateTime lastModifiedAt() { - return this.innerModel().lastModifiedAt(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public ClusterInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String clusterName; - - private ClusterUpdate updateCluster; - - public ClusterImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Cluster create() { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .createWithResponse(resourceGroupName, clusterName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Cluster create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .createWithResponse(resourceGroupName, clusterName, this.innerModel(), context) - .getValue(); - return this; - } - - ClusterImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = new ClusterInner(); - this.serviceManager = serviceManager; - this.clusterName = name; - } - - public ClusterImpl update() { - this.updateCluster = new ClusterUpdate(); - return this; - } - - public Cluster apply() { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .updateWithResponse(resourceGroupName, clusterName, updateCluster, Context.NONE) - .getValue(); - return this; - } - - public Cluster apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .updateWithResponse(resourceGroupName, clusterName, updateCluster, context) - .getValue(); - return this; - } - - ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); - } - - public Cluster refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) - .getValue(); - return this; - } - - public Cluster refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getClusters() - .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) - .getValue(); - return this; - } - - public ClusterImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ClusterImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ClusterImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateCluster.withTags(tags); - return this; - } - } - - public ClusterImpl withAadClientId(String aadClientId) { - this.innerModel().withAadClientId(aadClientId); - return this; - } - - public ClusterImpl withAadTenantId(String aadTenantId) { - this.innerModel().withAadTenantId(aadTenantId); - return this; - } - - public ClusterImpl withReportedProperties(ClusterReportedProperties reportedProperties) { - this.innerModel().withReportedProperties(reportedProperties); - return this; - } - - public ClusterImpl withCreatedBy(String createdBy) { - this.innerModel().withCreatedBy(createdBy); - return this; - } - - public ClusterImpl withCreatedByType(CreatedByType createdByType) { - this.innerModel().withCreatedByType(createdByType); - return this; - } - - public ClusterImpl withCreatedAt(OffsetDateTime createdAt) { - this.innerModel().withCreatedAt(createdAt); - return this; - } - - public ClusterImpl withLastModifiedBy(String lastModifiedBy) { - this.innerModel().withLastModifiedBy(lastModifiedBy); - return this; - } - - public ClusterImpl withLastModifiedByType(CreatedByType lastModifiedByType) { - this.innerModel().withLastModifiedByType(lastModifiedByType); - return this; - } - - public ClusterImpl withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.innerModel().withLastModifiedAt(lastModifiedAt); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java deleted file mode 100644 index ffdedeed7baa8..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.ClustersClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.Cluster; -import com.azure.resourcemanager.azurestackhci.models.Clusters; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ClustersImpl implements Clusters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClustersImpl.class); - - private final ClustersClient innerClient; - - private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - - public ClustersImpl( - ClustersClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); - } - - public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { - ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ClusterImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String clusterName) { - this.serviceClient().delete(resourceGroupName, clusterName); - } - - public Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, clusterName, context); - } - - public Cluster getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - this.deleteWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String clusterName = Utils.getValueFromIdByName(id, "clusters"); - if (clusterName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); - } - return this.deleteWithResponse(resourceGroupName, clusterName, context); - } - - private ClustersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { - return this.serviceManager; - } - - public ClusterImpl define(String name) { - return new ClusterImpl(name, this.manager()); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryimagesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryimagesImpl.java new file mode 100644 index 0000000000000..2760d358a0221 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryimagesImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryimagesInner; +import com.azure.resourcemanager.azurestackhci.models.Galleryimages; +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesPatch; +import com.azure.resourcemanager.azurestackhci.models.OperatingSystemTypes; +import java.util.Collections; +import java.util.Map; + +public final class GalleryimagesImpl implements Galleryimages, Galleryimages.Definition, Galleryimages.Update { + private GalleryimagesInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public GalleryimagesExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String containerName() { + return this.innerModel().containerName(); + } + + public String imagePath() { + return this.innerModel().imagePath(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public Object status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public GalleryimagesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String galleryimagesName; + + private GalleryimagesPatch updateGalleryimages; + + public GalleryimagesImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Galleryimages create() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryimagesOperations() + .createOrUpdate(resourceGroupName, galleryimagesName, this.innerModel(), Context.NONE); + return this; + } + + public Galleryimages create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryimagesOperations() + .createOrUpdate(resourceGroupName, galleryimagesName, this.innerModel(), context); + return this; + } + + GalleryimagesImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new GalleryimagesInner(); + this.serviceManager = serviceManager; + this.galleryimagesName = name; + } + + public GalleryimagesImpl update() { + this.updateGalleryimages = new GalleryimagesPatch(); + return this; + } + + public Galleryimages apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryimagesOperations() + .updateWithResponse(resourceGroupName, galleryimagesName, updateGalleryimages, Context.NONE) + .getValue(); + return this; + } + + public Galleryimages apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryimagesOperations() + .updateWithResponse(resourceGroupName, galleryimagesName, updateGalleryimages, context) + .getValue(); + return this; + } + + GalleryimagesImpl( + GalleryimagesInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.galleryimagesName = Utils.getValueFromIdByName(innerObject.id(), "galleryimages"); + } + + public Galleryimages refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryimagesOperations() + .getByResourceGroupWithResponse(resourceGroupName, galleryimagesName, Context.NONE) + .getValue(); + return this; + } + + public Galleryimages refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryimagesOperations() + .getByResourceGroupWithResponse(resourceGroupName, galleryimagesName, context) + .getValue(); + return this; + } + + public GalleryimagesImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public GalleryimagesImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public GalleryimagesImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateGalleryimages.withTags(tags); + return this; + } + } + + public GalleryimagesImpl withExtendedLocation(GalleryimagesExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public GalleryimagesImpl withContainerName(String containerName) { + this.innerModel().withContainerName(containerName); + return this; + } + + public GalleryimagesImpl withImagePath(String imagePath) { + this.innerModel().withImagePath(imagePath); + return this; + } + + public GalleryimagesImpl withOsType(OperatingSystemTypes osType) { + this.innerModel().withOsType(osType); + return this; + } + + public GalleryimagesImpl withProvisioningState(String provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public GalleryimagesImpl withResourceName(String resourceName) { + this.innerModel().withResourceName(resourceName); + return this; + } + + public GalleryimagesImpl withStatus(Object status) { + this.innerModel().withStatus(status); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryimagesOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryimagesOperationsClientImpl.java new file mode 100644 index 0000000000000..624b219fed996 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryimagesOperationsClientImpl.java @@ -0,0 +1,1364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.GalleryimagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryimagesInner; +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesListResult; +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesPatch; +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 GalleryimagesOperationsClient. */ +public final class GalleryimagesOperationsClientImpl implements GalleryimagesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final GalleryimagesOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of GalleryimagesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GalleryimagesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create(GalleryimagesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientGalleryimagesOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientG") + private interface GalleryimagesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/galleryimages/{galleryimagesName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryimagesName") String galleryimagesName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/galleryimages/{galleryimagesName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryimagesName") String galleryimagesName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryimagesInner galleryimages, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/galleryimages/{galleryimagesName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryimagesName") String galleryimagesName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/galleryimages/{galleryimagesName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryimagesName") String galleryimagesName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryimagesPatch galleryimages, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/galleryimages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/galleryimages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String galleryimagesName) { + 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 (galleryimagesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryimagesName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryimagesName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String galleryimagesName, 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 (galleryimagesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryimagesName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryimagesName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String galleryimagesName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryimagesName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryimagesInner getByResourceGroup(String resourceGroupName, String galleryimagesName) { + return getByResourceGroupAsync(resourceGroupName, galleryimagesName).block(); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryimagesName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryimagesName, context).block(); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages) { + 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 (galleryimagesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryimagesName is required and cannot be null.")); + } + if (galleryimages == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryimages is required and cannot be null.")); + } else { + galleryimages.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryimagesName, + this.client.getApiVersion(), + galleryimages, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages, 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 (galleryimagesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryimagesName is required and cannot be null.")); + } + if (galleryimages == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryimages is required and cannot be null.")); + } else { + galleryimages.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryimagesName, + this.client.getApiVersion(), + galleryimages, + accept, + context); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryimagesInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryimagesName, galleryimages); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryimagesInner.class, + GalleryimagesInner.class, + this.client.getContext()); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryimagesInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryimagesName, galleryimages, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryimagesInner.class, GalleryimagesInner.class, context); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryimagesInner> beginCreateOrUpdate( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryimagesName, galleryimages).getSyncPoller(); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryimagesInner> beginCreateOrUpdate( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryimagesName, galleryimages, context).getSyncPoller(); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryimagesName, galleryimages) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryimagesName, galleryimages, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryimagesInner createOrUpdate( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages) { + return createOrUpdateAsync(resourceGroupName, galleryimagesName, galleryimages).block(); + } + + /** + * Create or update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryimagesInner createOrUpdate( + String resourceGroupName, String galleryimagesName, GalleryimagesInner galleryimages, Context context) { + return createOrUpdateAsync(resourceGroupName, galleryimagesName, galleryimages, context).block(); + } + + /** + * Delete a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String galleryimagesName) { + 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 (galleryimagesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryimagesName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryimagesName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String galleryimagesName, 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 (galleryimagesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryimagesName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryimagesName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String galleryimagesName) { + return deleteWithResponseAsync(resourceGroupName, galleryimagesName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String galleryimagesName) { + deleteAsync(resourceGroupName, galleryimagesName).block(); + } + + /** + * Delete a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String galleryimagesName, Context context) { + return deleteWithResponseAsync(resourceGroupName, galleryimagesName, context).block(); + } + + /** + * Update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String galleryimagesName, GalleryimagesPatch galleryimages) { + 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 (galleryimagesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryimagesName is required and cannot be null.")); + } + if (galleryimages == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryimages is required and cannot be null.")); + } else { + galleryimages.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryimagesName, + this.client.getApiVersion(), + galleryimages, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String galleryimagesName, GalleryimagesPatch galleryimages, 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 (galleryimagesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryimagesName is required and cannot be null.")); + } + if (galleryimages == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryimages is required and cannot be null.")); + } else { + galleryimages.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryimagesName, + this.client.getApiVersion(), + galleryimages, + accept, + context); + } + + /** + * Update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String galleryimagesName, GalleryimagesPatch galleryimages) { + return updateWithResponseAsync(resourceGroupName, galleryimagesName, galleryimages) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryimagesInner update( + String resourceGroupName, String galleryimagesName, GalleryimagesPatch galleryimages) { + return updateAsync(resourceGroupName, galleryimagesName, galleryimages).block(); + } + + /** + * Update a galleryimage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @param galleryimages The galleryimages resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the galleryimages resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String galleryimagesName, GalleryimagesPatch galleryimages, Context context) { + return updateWithResponseAsync(resourceGroupName, galleryimagesName, galleryimages, context).block(); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all galleryimages under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List all galleryimages under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all galleryimages under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all galleryimages under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all galleryimages under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all galleryimages under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all galleryimages under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 list of galleryimages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of galleryimages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 list of galleryimages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryimagesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryimagesOperationsImpl.java new file mode 100644 index 0000000000000..9a016f9cedd23 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/GalleryimagesOperationsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.GalleryimagesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryimagesInner; +import com.azure.resourcemanager.azurestackhci.models.Galleryimages; +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesOperations; + +public final class GalleryimagesOperationsImpl implements GalleryimagesOperations { + private static final ClientLogger LOGGER = new ClientLogger(GalleryimagesOperationsImpl.class); + + private final GalleryimagesOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public GalleryimagesOperationsImpl( + GalleryimagesOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Galleryimages getByResourceGroup(String resourceGroupName, String galleryimagesName) { + GalleryimagesInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, galleryimagesName); + if (inner != null) { + return new GalleryimagesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryimagesName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, galleryimagesName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GalleryimagesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String galleryimagesName) { + this.serviceClient().delete(resourceGroupName, galleryimagesName); + } + + public Response deleteWithResponse(String resourceGroupName, String galleryimagesName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, galleryimagesName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new GalleryimagesImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new GalleryimagesImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new GalleryimagesImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new GalleryimagesImpl(inner1, this.manager())); + } + + public Galleryimages getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String galleryimagesName = Utils.getValueFromIdByName(id, "galleryimages"); + if (galleryimagesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryimages'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, galleryimagesName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String galleryimagesName = Utils.getValueFromIdByName(id, "galleryimages"); + if (galleryimagesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryimages'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, galleryimagesName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String galleryimagesName = Utils.getValueFromIdByName(id, "galleryimages"); + if (galleryimagesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryimages'.", id))); + } + this.deleteWithResponse(resourceGroupName, galleryimagesName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String galleryimagesName = Utils.getValueFromIdByName(id, "galleryimages"); + if (galleryimagesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleryimages'.", id))); + } + return this.deleteWithResponse(resourceGroupName, galleryimagesName, context); + } + + private GalleryimagesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public GalleryimagesImpl define(String name) { + return new GalleryimagesImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkinterfacesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkinterfacesImpl.java new file mode 100644 index 0000000000000..e7158ff086942 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkinterfacesImpl.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkinterfacesInner; +import com.azure.resourcemanager.azurestackhci.models.InterfaceDnsSettings; +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.azure.resourcemanager.azurestackhci.models.Networkinterfaces; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesPatch; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkinterfacesImpl + implements Networkinterfaces, Networkinterfaces.Definition, Networkinterfaces.Update { + private NetworkinterfacesInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public NetworkinterfacesExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String macAddress() { + return this.innerModel().macAddress(); + } + + public InterfaceDnsSettings dnsSettings() { + return this.innerModel().dnsSettings(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public Object status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkinterfacesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkinterfacesName; + + private NetworkinterfacesPatch updateNetworkinterfaces; + + public NetworkinterfacesImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Networkinterfaces create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkinterfacesOperations() + .createOrUpdate(resourceGroupName, networkinterfacesName, this.innerModel(), Context.NONE); + return this; + } + + public Networkinterfaces create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkinterfacesOperations() + .createOrUpdate(resourceGroupName, networkinterfacesName, this.innerModel(), context); + return this; + } + + NetworkinterfacesImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new NetworkinterfacesInner(); + this.serviceManager = serviceManager; + this.networkinterfacesName = name; + } + + public NetworkinterfacesImpl update() { + this.updateNetworkinterfaces = new NetworkinterfacesPatch(); + return this; + } + + public Networkinterfaces apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkinterfacesOperations() + .updateWithResponse(resourceGroupName, networkinterfacesName, updateNetworkinterfaces, Context.NONE) + .getValue(); + return this; + } + + public Networkinterfaces apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkinterfacesOperations() + .updateWithResponse(resourceGroupName, networkinterfacesName, updateNetworkinterfaces, context) + .getValue(); + return this; + } + + NetworkinterfacesImpl( + NetworkinterfacesInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkinterfacesName = Utils.getValueFromIdByName(innerObject.id(), "networkinterfaces"); + } + + public Networkinterfaces refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkinterfacesOperations() + .getByResourceGroupWithResponse(resourceGroupName, networkinterfacesName, Context.NONE) + .getValue(); + return this; + } + + public Networkinterfaces refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkinterfacesOperations() + .getByResourceGroupWithResponse(resourceGroupName, networkinterfacesName, context) + .getValue(); + return this; + } + + public NetworkinterfacesImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkinterfacesImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkinterfacesImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateNetworkinterfaces.withTags(tags); + return this; + } + } + + public NetworkinterfacesImpl withExtendedLocation(NetworkinterfacesExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public NetworkinterfacesImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public NetworkinterfacesImpl withMacAddress(String macAddress) { + this.innerModel().withMacAddress(macAddress); + return this; + } + + public NetworkinterfacesImpl withDnsSettings(InterfaceDnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + public NetworkinterfacesImpl withProvisioningState(String provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public NetworkinterfacesImpl withResourceName(String resourceName) { + this.innerModel().withResourceName(resourceName); + return this; + } + + public NetworkinterfacesImpl withStatus(Object status) { + this.innerModel().withStatus(status); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkinterfacesOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkinterfacesOperationsClientImpl.java new file mode 100644 index 0000000000000..09f75a20d2b39 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkinterfacesOperationsClientImpl.java @@ -0,0 +1,1322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.NetworkinterfacesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkinterfacesInner; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesListResult; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesPatch; +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 NetworkinterfacesOperationsClient. */ +public final class NetworkinterfacesOperationsClientImpl implements NetworkinterfacesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final NetworkinterfacesOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of NetworkinterfacesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkinterfacesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + NetworkinterfacesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientNetworkinterfacesOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientN") + private interface NetworkinterfacesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/networkinterfaces/{networkinterfacesName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkinterfacesName") String networkinterfacesName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/networkinterfaces/{networkinterfacesName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkinterfacesName") String networkinterfacesName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkinterfacesInner networkinterfaces, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/networkinterfaces/{networkinterfacesName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkinterfacesName") String networkinterfacesName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/networkinterfaces/{networkinterfacesName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkinterfacesName") String networkinterfacesName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkinterfacesPatch networkinterfaces, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/networkinterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkinterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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 networkinterfaces resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkinterfacesName) { + 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 (networkinterfacesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfacesName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkinterfacesName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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 networkinterfaces resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkinterfacesName, 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 (networkinterfacesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfacesName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkinterfacesName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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 networkinterfaces resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkinterfacesName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkinterfacesName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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 networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkinterfacesInner getByResourceGroup(String resourceGroupName, String networkinterfacesName) { + return getByResourceGroupAsync(resourceGroupName, networkinterfacesName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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 networkinterfaces resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkinterfacesName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkinterfacesName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesInner networkinterfaces) { + 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 (networkinterfacesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfacesName is required and cannot be null.")); + } + if (networkinterfaces == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfaces is required and cannot be null.")); + } else { + networkinterfaces.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkinterfacesName, + this.client.getApiVersion(), + networkinterfaces, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesInner networkinterfaces, + 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 (networkinterfacesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfacesName is required and cannot be null.")); + } + if (networkinterfaces == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfaces is required and cannot be null.")); + } else { + networkinterfaces.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkinterfacesName, + this.client.getApiVersion(), + networkinterfaces, + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkinterfacesInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesInner networkinterfaces) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkinterfacesName, networkinterfaces); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkinterfacesInner.class, + NetworkinterfacesInner.class, + this.client.getContext()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkinterfacesInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesInner networkinterfaces, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, networkinterfacesName, networkinterfaces, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkinterfacesInner.class, + NetworkinterfacesInner.class, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkinterfacesInner> beginCreateOrUpdate( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesInner networkinterfaces) { + return beginCreateOrUpdateAsync(resourceGroupName, networkinterfacesName, networkinterfaces).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkinterfacesInner> beginCreateOrUpdate( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesInner networkinterfaces, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkinterfacesName, networkinterfaces, context) + .getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesInner networkinterfaces) { + return beginCreateOrUpdateAsync(resourceGroupName, networkinterfacesName, networkinterfaces) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesInner networkinterfaces, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkinterfacesName, networkinterfaces, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkinterfacesInner createOrUpdate( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesInner networkinterfaces) { + return createOrUpdateAsync(resourceGroupName, networkinterfacesName, networkinterfaces).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkinterfacesInner createOrUpdate( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesInner networkinterfaces, + Context context) { + return createOrUpdateAsync(resourceGroupName, networkinterfacesName, networkinterfaces, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String networkinterfacesName) { + 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 (networkinterfacesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfacesName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkinterfacesName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String networkinterfacesName, 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 (networkinterfacesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfacesName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkinterfacesName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkinterfacesName) { + return deleteWithResponseAsync(resourceGroupName, networkinterfacesName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String networkinterfacesName) { + deleteAsync(resourceGroupName, networkinterfacesName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String networkinterfacesName, Context context) { + return deleteWithResponseAsync(resourceGroupName, networkinterfacesName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesPatch networkinterfaces) { + 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 (networkinterfacesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfacesName is required and cannot be null.")); + } + if (networkinterfaces == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfaces is required and cannot be null.")); + } else { + networkinterfaces.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkinterfacesName, + this.client.getApiVersion(), + networkinterfaces, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesPatch networkinterfaces, + 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 (networkinterfacesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfacesName is required and cannot be null.")); + } + if (networkinterfaces == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkinterfaces is required and cannot be null.")); + } else { + networkinterfaces.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + networkinterfacesName, + this.client.getApiVersion(), + networkinterfaces, + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesPatch networkinterfaces) { + return updateWithResponseAsync(resourceGroupName, networkinterfacesName, networkinterfaces) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkinterfacesInner update( + String resourceGroupName, String networkinterfacesName, NetworkinterfacesPatch networkinterfaces) { + return updateAsync(resourceGroupName, networkinterfacesName, networkinterfaces).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param networkinterfaces The networkinterfaces resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String networkinterfacesName, + NetworkinterfacesPatch networkinterfaces, + Context context) { + return updateWithResponseAsync(resourceGroupName, networkinterfacesName, networkinterfaces, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkinterfacesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkinterfacesOperationsImpl.java new file mode 100644 index 0000000000000..afe6452940caa --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/NetworkinterfacesOperationsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.NetworkinterfacesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkinterfacesInner; +import com.azure.resourcemanager.azurestackhci.models.Networkinterfaces; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesOperations; + +public final class NetworkinterfacesOperationsImpl implements NetworkinterfacesOperations { + private static final ClientLogger LOGGER = new ClientLogger(NetworkinterfacesOperationsImpl.class); + + private final NetworkinterfacesOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public NetworkinterfacesOperationsImpl( + NetworkinterfacesOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Networkinterfaces getByResourceGroup(String resourceGroupName, String networkinterfacesName) { + NetworkinterfacesInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, networkinterfacesName); + if (inner != null) { + return new NetworkinterfacesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkinterfacesName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkinterfacesName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkinterfacesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkinterfacesName) { + this.serviceClient().delete(resourceGroupName, networkinterfacesName); + } + + public Response deleteWithResponse(String resourceGroupName, String networkinterfacesName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, networkinterfacesName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkinterfacesImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkinterfacesImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkinterfacesImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkinterfacesImpl(inner1, this.manager())); + } + + public Networkinterfaces getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkinterfacesName = Utils.getValueFromIdByName(id, "networkinterfaces"); + if (networkinterfacesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkinterfaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkinterfacesName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkinterfacesName = Utils.getValueFromIdByName(id, "networkinterfaces"); + if (networkinterfacesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkinterfaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkinterfacesName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkinterfacesName = Utils.getValueFromIdByName(id, "networkinterfaces"); + if (networkinterfacesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkinterfaces'.", id))); + } + this.deleteWithResponse(resourceGroupName, networkinterfacesName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkinterfacesName = Utils.getValueFromIdByName(id, "networkinterfaces"); + if (networkinterfacesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkinterfaces'.", id))); + } + return this.deleteWithResponse(resourceGroupName, networkinterfacesName, context); + } + + private NetworkinterfacesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public NetworkinterfacesImpl define(String name) { + return new NetworkinterfacesImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AvailableOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java similarity index 62% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AvailableOperationsImpl.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java index 5b15c5c41e449..5d406ea17f054 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AvailableOperationsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java @@ -4,26 +4,26 @@ package com.azure.resourcemanager.azurestackhci.implementation; -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; -import com.azure.resourcemanager.azurestackhci.models.AvailableOperations; -import com.azure.resourcemanager.azurestackhci.models.OperationDetail; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.azurestackhci.models.Operation; +import com.azure.resourcemanager.azurestackhci.models.OperationListResult; import java.util.Collections; import java.util.List; -public final class AvailableOperationsImpl implements AvailableOperations { - private AvailableOperationsInner innerObject; +public final class OperationListResultImpl implements OperationListResult { + private OperationListResultInner innerObject; private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - AvailableOperationsImpl( - AvailableOperationsInner innerObject, + OperationListResultImpl( + OperationListResultInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public List value() { - List inner = this.innerModel().value(); + public List value() { + List inner = this.innerModel().value(); if (inner != null) { return Collections.unmodifiableList(inner); } else { @@ -35,7 +35,7 @@ public String nextLink() { return this.innerModel().nextLink(); } - public AvailableOperationsInner innerModel() { + public OperationListResultInner innerModel() { return this.innerObject; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java index 96b74acc66565..9bdf4c5016496 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java @@ -20,15 +20,12 @@ 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.azurestackhci.fluent.OperationsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; import reactor.core.publisher.Mono; /** 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; @@ -57,7 +54,7 @@ private interface OperationsService { @Get("/providers/Microsoft.AzureStackHCI/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -69,10 +66,11 @@ 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 available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { + private Mono> listWithResponseAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -93,10 +91,11 @@ private Mono> listWithResponseAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { + private Mono> listWithResponseAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -113,13 +112,14 @@ private Mono> listWithResponseAsync(Context c * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { + private Mono listAsync() { return listWithResponseAsync() .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -133,10 +133,10 @@ private Mono listAsync() { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AvailableOperationsInner list() { + public OperationListResultInner list() { return listAsync().block(); } @@ -147,10 +147,10 @@ public AvailableOperationsInner 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 available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { + public Response listWithResponse(Context context) { return listWithResponseAsync(context).block(); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java index 25b04346c2d58..9a5400b784a4d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java @@ -9,13 +9,12 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; -import com.azure.resourcemanager.azurestackhci.models.AvailableOperations; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.azurestackhci.models.OperationListResult; import com.azure.resourcemanager.azurestackhci.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; @@ -27,23 +26,23 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public AvailableOperations list() { - AvailableOperationsInner inner = this.serviceClient().list(); + public OperationListResult list() { + OperationListResultInner inner = this.serviceClient().list(); if (inner != null) { - return new AvailableOperationsImpl(inner, this.manager()); + return new OperationListResultImpl(inner, this.manager()); } else { return null; } } - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AvailableOperationsImpl(inner.getValue(), this.manager())); + new OperationListResultImpl(inner.getValue(), this.manager())); } else { return null; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StoragecontainersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StoragecontainersImpl.java new file mode 100644 index 0000000000000..f4403b849c64a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StoragecontainersImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.StoragecontainersInner; +import com.azure.resourcemanager.azurestackhci.models.Storagecontainers; +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersPatch; +import java.util.Collections; +import java.util.Map; + +public final class StoragecontainersImpl + implements Storagecontainers, Storagecontainers.Definition, Storagecontainers.Update { + private StoragecontainersInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public StoragecontainersExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String path() { + return this.innerModel().path(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public Object status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public StoragecontainersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storagecontainersName; + + private StoragecontainersPatch updateStoragecontainers; + + public StoragecontainersImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Storagecontainers create() { + this.innerObject = + serviceManager + .serviceClient() + .getStoragecontainersOperations() + .createOrUpdate(resourceGroupName, storagecontainersName, this.innerModel(), Context.NONE); + return this; + } + + public Storagecontainers create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStoragecontainersOperations() + .createOrUpdate(resourceGroupName, storagecontainersName, this.innerModel(), context); + return this; + } + + StoragecontainersImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new StoragecontainersInner(); + this.serviceManager = serviceManager; + this.storagecontainersName = name; + } + + public StoragecontainersImpl update() { + this.updateStoragecontainers = new StoragecontainersPatch(); + return this; + } + + public Storagecontainers apply() { + this.innerObject = + serviceManager + .serviceClient() + .getStoragecontainersOperations() + .updateWithResponse(resourceGroupName, storagecontainersName, updateStoragecontainers, Context.NONE) + .getValue(); + return this; + } + + public Storagecontainers apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStoragecontainersOperations() + .updateWithResponse(resourceGroupName, storagecontainersName, updateStoragecontainers, context) + .getValue(); + return this; + } + + StoragecontainersImpl( + StoragecontainersInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.storagecontainersName = Utils.getValueFromIdByName(innerObject.id(), "storagecontainers"); + } + + public Storagecontainers refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStoragecontainersOperations() + .getByResourceGroupWithResponse(resourceGroupName, storagecontainersName, Context.NONE) + .getValue(); + return this; + } + + public Storagecontainers refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStoragecontainersOperations() + .getByResourceGroupWithResponse(resourceGroupName, storagecontainersName, context) + .getValue(); + return this; + } + + public StoragecontainersImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public StoragecontainersImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public StoragecontainersImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateStoragecontainers.withTags(tags); + return this; + } + } + + public StoragecontainersImpl withExtendedLocation(StoragecontainersExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public StoragecontainersImpl withPath(String path) { + this.innerModel().withPath(path); + return this; + } + + public StoragecontainersImpl withProvisioningState(String provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public StoragecontainersImpl withResourceName(String resourceName) { + this.innerModel().withResourceName(resourceName); + return this; + } + + public StoragecontainersImpl withStatus(Object status) { + this.innerModel().withStatus(status); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StoragecontainersOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StoragecontainersOperationsClientImpl.java new file mode 100644 index 0000000000000..f834312ddf00b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StoragecontainersOperationsClientImpl.java @@ -0,0 +1,1322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.StoragecontainersOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.StoragecontainersInner; +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersListResult; +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersPatch; +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 StoragecontainersOperationsClient. */ +public final class StoragecontainersOperationsClientImpl implements StoragecontainersOperationsClient { + /** The proxy service used to perform REST calls. */ + private final StoragecontainersOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of StoragecontainersOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StoragecontainersOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + StoragecontainersOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientStoragecontainersOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientS") + private interface StoragecontainersOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/storagecontainers/{storagecontainersName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storagecontainersName") String storagecontainersName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/storagecontainers/{storagecontainersName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storagecontainersName") String storagecontainersName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StoragecontainersInner storagecontainers, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/storagecontainers/{storagecontainersName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storagecontainersName") String storagecontainersName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/storagecontainers/{storagecontainersName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storagecontainersName") String storagecontainersName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StoragecontainersPatch storagecontainers, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/storagecontainers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/storagecontainers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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 storagecontainers resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String storagecontainersName) { + 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 (storagecontainersName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainersName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storagecontainersName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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 storagecontainers resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String storagecontainersName, 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 (storagecontainersName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainersName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storagecontainersName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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 storagecontainers resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String storagecontainersName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storagecontainersName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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 storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StoragecontainersInner getByResourceGroup(String resourceGroupName, String storagecontainersName) { + return getByResourceGroupAsync(resourceGroupName, storagecontainersName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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 storagecontainers resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String storagecontainersName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storagecontainersName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String storagecontainersName, StoragecontainersInner storagecontainers) { + 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 (storagecontainersName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainersName is required and cannot be null.")); + } + if (storagecontainers == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainers is required and cannot be null.")); + } else { + storagecontainers.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storagecontainersName, + this.client.getApiVersion(), + storagecontainers, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String storagecontainersName, + StoragecontainersInner storagecontainers, + 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 (storagecontainersName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainersName is required and cannot be null.")); + } + if (storagecontainers == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainers is required and cannot be null.")); + } else { + storagecontainers.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storagecontainersName, + this.client.getApiVersion(), + storagecontainers, + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StoragecontainersInner> beginCreateOrUpdateAsync( + String resourceGroupName, String storagecontainersName, StoragecontainersInner storagecontainers) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, storagecontainersName, storagecontainers); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StoragecontainersInner.class, + StoragecontainersInner.class, + this.client.getContext()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StoragecontainersInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String storagecontainersName, + StoragecontainersInner storagecontainers, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, storagecontainersName, storagecontainers, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StoragecontainersInner.class, + StoragecontainersInner.class, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StoragecontainersInner> beginCreateOrUpdate( + String resourceGroupName, String storagecontainersName, StoragecontainersInner storagecontainers) { + return beginCreateOrUpdateAsync(resourceGroupName, storagecontainersName, storagecontainers).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StoragecontainersInner> beginCreateOrUpdate( + String resourceGroupName, + String storagecontainersName, + StoragecontainersInner storagecontainers, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, storagecontainersName, storagecontainers, context) + .getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String storagecontainersName, StoragecontainersInner storagecontainers) { + return beginCreateOrUpdateAsync(resourceGroupName, storagecontainersName, storagecontainers) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String storagecontainersName, + StoragecontainersInner storagecontainers, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, storagecontainersName, storagecontainers, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StoragecontainersInner createOrUpdate( + String resourceGroupName, String storagecontainersName, StoragecontainersInner storagecontainers) { + return createOrUpdateAsync(resourceGroupName, storagecontainersName, storagecontainers).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StoragecontainersInner createOrUpdate( + String resourceGroupName, + String storagecontainersName, + StoragecontainersInner storagecontainers, + Context context) { + return createOrUpdateAsync(resourceGroupName, storagecontainersName, storagecontainers, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String storagecontainersName) { + 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 (storagecontainersName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainersName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storagecontainersName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String storagecontainersName, 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 (storagecontainersName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainersName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storagecontainersName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String storagecontainersName) { + return deleteWithResponseAsync(resourceGroupName, storagecontainersName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String storagecontainersName) { + deleteAsync(resourceGroupName, storagecontainersName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String storagecontainersName, Context context) { + return deleteWithResponseAsync(resourceGroupName, storagecontainersName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String storagecontainersName, StoragecontainersPatch storagecontainers) { + 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 (storagecontainersName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainersName is required and cannot be null.")); + } + if (storagecontainers == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainers is required and cannot be null.")); + } else { + storagecontainers.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storagecontainersName, + this.client.getApiVersion(), + storagecontainers, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String storagecontainersName, + StoragecontainersPatch storagecontainers, + 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 (storagecontainersName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainersName is required and cannot be null.")); + } + if (storagecontainers == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagecontainers is required and cannot be null.")); + } else { + storagecontainers.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storagecontainersName, + this.client.getApiVersion(), + storagecontainers, + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String storagecontainersName, StoragecontainersPatch storagecontainers) { + return updateWithResponseAsync(resourceGroupName, storagecontainersName, storagecontainers) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StoragecontainersInner update( + String resourceGroupName, String storagecontainersName, StoragecontainersPatch storagecontainers) { + return updateAsync(resourceGroupName, storagecontainersName, storagecontainers).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param storagecontainers The storagecontainers resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String storagecontainersName, + StoragecontainersPatch storagecontainers, + Context context) { + return updateWithResponseAsync(resourceGroupName, storagecontainersName, storagecontainers, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StoragecontainersOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StoragecontainersOperationsImpl.java new file mode 100644 index 0000000000000..67bb882040429 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/StoragecontainersOperationsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.StoragecontainersOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.StoragecontainersInner; +import com.azure.resourcemanager.azurestackhci.models.Storagecontainers; +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersOperations; + +public final class StoragecontainersOperationsImpl implements StoragecontainersOperations { + private static final ClientLogger LOGGER = new ClientLogger(StoragecontainersOperationsImpl.class); + + private final StoragecontainersOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public StoragecontainersOperationsImpl( + StoragecontainersOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Storagecontainers getByResourceGroup(String resourceGroupName, String storagecontainersName) { + StoragecontainersInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, storagecontainersName); + if (inner != null) { + return new StoragecontainersImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String storagecontainersName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, storagecontainersName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StoragecontainersImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String storagecontainersName) { + this.serviceClient().delete(resourceGroupName, storagecontainersName); + } + + public Response deleteWithResponse(String resourceGroupName, String storagecontainersName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, storagecontainersName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new StoragecontainersImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new StoragecontainersImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new StoragecontainersImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new StoragecontainersImpl(inner1, this.manager())); + } + + public Storagecontainers getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storagecontainersName = Utils.getValueFromIdByName(id, "storagecontainers"); + if (storagecontainersName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storagecontainers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storagecontainersName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storagecontainersName = Utils.getValueFromIdByName(id, "storagecontainers"); + if (storagecontainersName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storagecontainers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storagecontainersName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storagecontainersName = Utils.getValueFromIdByName(id, "storagecontainers"); + if (storagecontainersName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storagecontainers'.", id))); + } + this.deleteWithResponse(resourceGroupName, storagecontainersName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storagecontainersName = Utils.getValueFromIdByName(id, "storagecontainers"); + if (storagecontainersName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storagecontainers'.", id))); + } + return this.deleteWithResponse(resourceGroupName, storagecontainersName, context); + } + + private StoragecontainersOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public StoragecontainersImpl define(String name) { + return new StoragecontainersImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualharddisksImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualharddisksImpl.java new file mode 100644 index 0000000000000..57cae374f5cb3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualharddisksImpl.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualharddisksInner; +import com.azure.resourcemanager.azurestackhci.models.Virtualharddisks; +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksPatch; +import java.util.Collections; +import java.util.Map; + +public final class VirtualharddisksImpl + implements Virtualharddisks, Virtualharddisks.Definition, Virtualharddisks.Update { + private VirtualharddisksInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VirtualharddisksExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public Integer blockSizeBytes() { + return this.innerModel().blockSizeBytes(); + } + + public Long diskSizeBytes() { + return this.innerModel().diskSizeBytes(); + } + + public Boolean dynamic() { + return this.innerModel().dynamic(); + } + + public Integer logicalSectorBytes() { + return this.innerModel().logicalSectorBytes(); + } + + public Integer physicalSectorBytes() { + return this.innerModel().physicalSectorBytes(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public Object status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualharddisksInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualharddisksName; + + private VirtualharddisksPatch updateVirtualharddisks; + + public VirtualharddisksImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Virtualharddisks create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualharddisksOperations() + .createOrUpdate(resourceGroupName, virtualharddisksName, this.innerModel(), Context.NONE); + return this; + } + + public Virtualharddisks create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualharddisksOperations() + .createOrUpdate(resourceGroupName, virtualharddisksName, this.innerModel(), context); + return this; + } + + VirtualharddisksImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new VirtualharddisksInner(); + this.serviceManager = serviceManager; + this.virtualharddisksName = name; + } + + public VirtualharddisksImpl update() { + this.updateVirtualharddisks = new VirtualharddisksPatch(); + return this; + } + + public Virtualharddisks apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualharddisksOperations() + .updateWithResponse(resourceGroupName, virtualharddisksName, updateVirtualharddisks, Context.NONE) + .getValue(); + return this; + } + + public Virtualharddisks apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualharddisksOperations() + .updateWithResponse(resourceGroupName, virtualharddisksName, updateVirtualharddisks, context) + .getValue(); + return this; + } + + VirtualharddisksImpl( + VirtualharddisksInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualharddisksName = Utils.getValueFromIdByName(innerObject.id(), "virtualharddisks"); + } + + public Virtualharddisks refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualharddisksOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualharddisksName, Context.NONE) + .getValue(); + return this; + } + + public Virtualharddisks refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualharddisksOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualharddisksName, context) + .getValue(); + return this; + } + + public VirtualharddisksImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualharddisksImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualharddisksImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVirtualharddisks.withTags(tags); + return this; + } + } + + public VirtualharddisksImpl withExtendedLocation(VirtualharddisksExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualharddisksImpl withBlockSizeBytes(Integer blockSizeBytes) { + this.innerModel().withBlockSizeBytes(blockSizeBytes); + return this; + } + + public VirtualharddisksImpl withDiskSizeBytes(Long diskSizeBytes) { + this.innerModel().withDiskSizeBytes(diskSizeBytes); + return this; + } + + public VirtualharddisksImpl withDynamic(Boolean dynamic) { + this.innerModel().withDynamic(dynamic); + return this; + } + + public VirtualharddisksImpl withLogicalSectorBytes(Integer logicalSectorBytes) { + this.innerModel().withLogicalSectorBytes(logicalSectorBytes); + return this; + } + + public VirtualharddisksImpl withPhysicalSectorBytes(Integer physicalSectorBytes) { + this.innerModel().withPhysicalSectorBytes(physicalSectorBytes); + return this; + } + + public VirtualharddisksImpl withProvisioningState(String provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public VirtualharddisksImpl withResourceName(String resourceName) { + this.innerModel().withResourceName(resourceName); + return this; + } + + public VirtualharddisksImpl withStatus(Object status) { + this.innerModel().withStatus(status); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualharddisksOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualharddisksOperationsClientImpl.java new file mode 100644 index 0000000000000..e2248ae5c2d93 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualharddisksOperationsClientImpl.java @@ -0,0 +1,1317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualharddisksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualharddisksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksListResult; +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksPatch; +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 VirtualharddisksOperationsClient. */ +public final class VirtualharddisksOperationsClientImpl implements VirtualharddisksOperationsClient { + /** The proxy service used to perform REST calls. */ + private final VirtualharddisksOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of VirtualharddisksOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualharddisksOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + VirtualharddisksOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientVirtualharddisksOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientV") + private interface VirtualharddisksOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualharddisks/{virtualharddisksName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualharddisksName") String virtualharddisksName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualharddisks/{virtualharddisksName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualharddisksName") String virtualharddisksName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualharddisksInner virtualharddisks, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualharddisks/{virtualharddisksName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualharddisksName") String virtualharddisksName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualharddisks/{virtualharddisksName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualharddisksName") String virtualharddisksName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualharddisksPatch virtualharddisks, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualharddisks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualharddisks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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 virtualharddisks resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualharddisksName) { + 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 (virtualharddisksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisksName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualharddisksName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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 virtualharddisks resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualharddisksName, 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 (virtualharddisksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisksName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualharddisksName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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 virtualharddisks resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualharddisksName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualharddisksName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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 virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualharddisksInner getByResourceGroup(String resourceGroupName, String virtualharddisksName) { + return getByResourceGroupAsync(resourceGroupName, virtualharddisksName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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 virtualharddisks resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualharddisksName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualharddisksName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualharddisksName, VirtualharddisksInner virtualharddisks) { + 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 (virtualharddisksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisksName is required and cannot be null.")); + } + if (virtualharddisks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisks is required and cannot be null.")); + } else { + virtualharddisks.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualharddisksName, + this.client.getApiVersion(), + virtualharddisks, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualharddisksName, + VirtualharddisksInner virtualharddisks, + 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 (virtualharddisksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisksName is required and cannot be null.")); + } + if (virtualharddisks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisks is required and cannot be null.")); + } else { + virtualharddisks.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualharddisksName, + this.client.getApiVersion(), + virtualharddisks, + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualharddisksInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualharddisksName, VirtualharddisksInner virtualharddisks) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualharddisksName, virtualharddisks); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualharddisksInner.class, + VirtualharddisksInner.class, + this.client.getContext()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualharddisksInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualharddisksName, + VirtualharddisksInner virtualharddisks, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualharddisksName, virtualharddisks, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualharddisksInner.class, VirtualharddisksInner.class, context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualharddisksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualharddisksName, VirtualharddisksInner virtualharddisks) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualharddisksName, virtualharddisks).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualharddisksInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualharddisksName, + VirtualharddisksInner virtualharddisks, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualharddisksName, virtualharddisks, context) + .getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualharddisksName, VirtualharddisksInner virtualharddisks) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualharddisksName, virtualharddisks) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualharddisksName, + VirtualharddisksInner virtualharddisks, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualharddisksName, virtualharddisks, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualharddisksInner createOrUpdate( + String resourceGroupName, String virtualharddisksName, VirtualharddisksInner virtualharddisks) { + return createOrUpdateAsync(resourceGroupName, virtualharddisksName, virtualharddisks).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualharddisksInner createOrUpdate( + String resourceGroupName, + String virtualharddisksName, + VirtualharddisksInner virtualharddisks, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualharddisksName, virtualharddisks, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String virtualharddisksName) { + 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 (virtualharddisksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisksName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualharddisksName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String virtualharddisksName, 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 (virtualharddisksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisksName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualharddisksName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualharddisksName) { + return deleteWithResponseAsync(resourceGroupName, virtualharddisksName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String virtualharddisksName) { + deleteAsync(resourceGroupName, virtualharddisksName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String virtualharddisksName, Context context) { + return deleteWithResponseAsync(resourceGroupName, virtualharddisksName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String virtualharddisksName, VirtualharddisksPatch virtualharddisks) { + 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 (virtualharddisksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisksName is required and cannot be null.")); + } + if (virtualharddisks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisks is required and cannot be null.")); + } else { + virtualharddisks.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualharddisksName, + this.client.getApiVersion(), + virtualharddisks, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String virtualharddisksName, + VirtualharddisksPatch virtualharddisks, + 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 (virtualharddisksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisksName is required and cannot be null.")); + } + if (virtualharddisks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualharddisks is required and cannot be null.")); + } else { + virtualharddisks.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualharddisksName, + this.client.getApiVersion(), + virtualharddisks, + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String virtualharddisksName, VirtualharddisksPatch virtualharddisks) { + return updateWithResponseAsync(resourceGroupName, virtualharddisksName, virtualharddisks) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualharddisksInner update( + String resourceGroupName, String virtualharddisksName, VirtualharddisksPatch virtualharddisks) { + return updateAsync(resourceGroupName, virtualharddisksName, virtualharddisks).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param virtualharddisks The virtualharddisks resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String virtualharddisksName, + VirtualharddisksPatch virtualharddisks, + Context context) { + return updateWithResponseAsync(resourceGroupName, virtualharddisksName, virtualharddisks, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualharddisksOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualharddisksOperationsImpl.java new file mode 100644 index 0000000000000..494573016c0e0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualharddisksOperationsImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.VirtualharddisksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualharddisksInner; +import com.azure.resourcemanager.azurestackhci.models.Virtualharddisks; +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksOperations; + +public final class VirtualharddisksOperationsImpl implements VirtualharddisksOperations { + private static final ClientLogger LOGGER = new ClientLogger(VirtualharddisksOperationsImpl.class); + + private final VirtualharddisksOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public VirtualharddisksOperationsImpl( + VirtualharddisksOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Virtualharddisks getByResourceGroup(String resourceGroupName, String virtualharddisksName) { + VirtualharddisksInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualharddisksName); + if (inner != null) { + return new VirtualharddisksImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualharddisksName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualharddisksName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualharddisksImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualharddisksName) { + this.serviceClient().delete(resourceGroupName, virtualharddisksName); + } + + public Response deleteWithResponse(String resourceGroupName, String virtualharddisksName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, virtualharddisksName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualharddisksImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualharddisksImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualharddisksImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualharddisksImpl(inner1, this.manager())); + } + + public Virtualharddisks getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualharddisksName = Utils.getValueFromIdByName(id, "virtualharddisks"); + if (virtualharddisksName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualharddisks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualharddisksName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualharddisksName = Utils.getValueFromIdByName(id, "virtualharddisks"); + if (virtualharddisksName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualharddisks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualharddisksName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualharddisksName = Utils.getValueFromIdByName(id, "virtualharddisks"); + if (virtualharddisksName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualharddisks'.", id))); + } + this.deleteWithResponse(resourceGroupName, virtualharddisksName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualharddisksName = Utils.getValueFromIdByName(id, "virtualharddisks"); + if (virtualharddisksName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualharddisks'.", id))); + } + return this.deleteWithResponse(resourceGroupName, virtualharddisksName, context); + } + + private VirtualharddisksOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public VirtualharddisksImpl define(String name) { + return new VirtualharddisksImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualmachinesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualmachinesImpl.java new file mode 100644 index 0000000000000..fb80f7df5323a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualmachinesImpl.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualmachinesInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualMachineUpdateProperties; +import com.azure.resourcemanager.azurestackhci.models.Virtualmachines; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPatch; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesSecurityProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesStorageProfile; +import java.util.Collections; +import java.util.Map; + +public final class VirtualmachinesImpl implements Virtualmachines, Virtualmachines.Definition, Virtualmachines.Update { + private VirtualmachinesInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VirtualmachinesExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public VirtualmachinesPropertiesHardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public VirtualmachinesPropertiesNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public VirtualmachinesPropertiesOsProfile osProfile() { + return this.innerModel().osProfile(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public VirtualmachinesPropertiesSecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public VirtualmachinesPropertiesStorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Object status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualmachinesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualmachinesName; + + private VirtualmachinesPatch updateVirtualmachines; + + public VirtualmachinesImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Virtualmachines create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualmachinesOperations() + .createOrUpdate(resourceGroupName, virtualmachinesName, this.innerModel(), Context.NONE); + return this; + } + + public Virtualmachines create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualmachinesOperations() + .createOrUpdate(resourceGroupName, virtualmachinesName, this.innerModel(), context); + return this; + } + + VirtualmachinesImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new VirtualmachinesInner(); + this.serviceManager = serviceManager; + this.virtualmachinesName = name; + } + + public VirtualmachinesImpl update() { + this.updateVirtualmachines = new VirtualmachinesPatch(); + return this; + } + + public Virtualmachines apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualmachinesOperations() + .updateWithResponse(resourceGroupName, virtualmachinesName, updateVirtualmachines, Context.NONE) + .getValue(); + return this; + } + + public Virtualmachines apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualmachinesOperations() + .updateWithResponse(resourceGroupName, virtualmachinesName, updateVirtualmachines, context) + .getValue(); + return this; + } + + VirtualmachinesImpl( + VirtualmachinesInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualmachinesName = Utils.getValueFromIdByName(innerObject.id(), "virtualmachines"); + } + + public Virtualmachines refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualmachinesOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualmachinesName, Context.NONE) + .getValue(); + return this; + } + + public Virtualmachines refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualmachinesOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualmachinesName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.virtualmachinesOperations().start(resourceGroupName, virtualmachinesName); + } + + public void start(Context context) { + serviceManager.virtualmachinesOperations().start(resourceGroupName, virtualmachinesName, context); + } + + public void stop() { + serviceManager.virtualmachinesOperations().stop(resourceGroupName, virtualmachinesName); + } + + public void stop(Context context) { + serviceManager.virtualmachinesOperations().stop(resourceGroupName, virtualmachinesName, context); + } + + public void restart() { + serviceManager.virtualmachinesOperations().restart(resourceGroupName, virtualmachinesName); + } + + public void restart(Context context) { + serviceManager.virtualmachinesOperations().restart(resourceGroupName, virtualmachinesName, context); + } + + public VirtualmachinesImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualmachinesImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualmachinesImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVirtualmachines.withTags(tags); + return this; + } + } + + public VirtualmachinesImpl withExtendedLocation(VirtualmachinesExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualmachinesImpl withHardwareProfile(VirtualmachinesPropertiesHardwareProfile hardwareProfile) { + this.innerModel().withHardwareProfile(hardwareProfile); + return this; + } + + public VirtualmachinesImpl withNetworkProfile(VirtualmachinesPropertiesNetworkProfile networkProfile) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } + + public VirtualmachinesImpl withOsProfile(VirtualmachinesPropertiesOsProfile osProfile) { + this.innerModel().withOsProfile(osProfile); + return this; + } + + public VirtualmachinesImpl withResourceName(String resourceName) { + this.innerModel().withResourceName(resourceName); + return this; + } + + public VirtualmachinesImpl withSecurityProfile(VirtualmachinesPropertiesSecurityProfile securityProfile) { + this.innerModel().withSecurityProfile(securityProfile); + return this; + } + + public VirtualmachinesImpl withStorageProfile(VirtualmachinesPropertiesStorageProfile storageProfile) { + this.innerModel().withStorageProfile(storageProfile); + return this; + } + + public VirtualmachinesImpl withProvisioningState(String provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public VirtualmachinesImpl withStatus(Object status) { + this.innerModel().withStatus(status); + return this; + } + + public VirtualmachinesImpl withProperties(VirtualMachineUpdateProperties properties) { + this.updateVirtualmachines.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualmachinesOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualmachinesOperationsClientImpl.java new file mode 100644 index 0000000000000..df09c95291237 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualmachinesOperationsClientImpl.java @@ -0,0 +1,1979 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualmachinesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualmachinesInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesListResult; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPatch; +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 VirtualmachinesOperationsClient. */ +public final class VirtualmachinesOperationsClientImpl implements VirtualmachinesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final VirtualmachinesOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of VirtualmachinesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualmachinesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + VirtualmachinesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientVirtualmachinesOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientV") + private interface VirtualmachinesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualmachines/{virtualmachinesName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualmachinesName") String virtualmachinesName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualmachines/{virtualmachinesName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualmachinesName") String virtualmachinesName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualmachinesInner virtualmachines, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualmachines/{virtualmachinesName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualmachinesName") String virtualmachinesName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualmachines/{virtualmachinesName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualmachinesName") String virtualmachinesName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualmachinesPatch virtualmachines, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualmachines/{virtualmachinesName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualmachinesName") String virtualmachinesName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualmachines/{virtualmachinesName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualmachinesName") String virtualmachinesName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualmachines/{virtualmachinesName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualmachinesName") String virtualmachinesName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualmachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualmachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 virtualmachines resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualmachinesName) { + 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 virtualmachines resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualmachinesName, 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 virtualmachines resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualmachinesName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualmachinesName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualmachinesInner getByResourceGroup(String resourceGroupName, String virtualmachinesName) { + return getByResourceGroupAsync(resourceGroupName, virtualmachinesName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 virtualmachines resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualmachinesName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualmachinesName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines) { + 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + if (virtualmachines == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachines is required and cannot be null.")); + } else { + virtualmachines.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + virtualmachines, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines, 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + if (virtualmachines == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachines is required and cannot be null.")); + } else { + virtualmachines.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + virtualmachines, + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualmachinesInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualmachinesName, virtualmachines); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualmachinesInner.class, + VirtualmachinesInner.class, + this.client.getContext()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualmachinesInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualmachinesName, virtualmachines, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualmachinesInner.class, VirtualmachinesInner.class, context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualmachinesInner> beginCreateOrUpdate( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualmachinesName, virtualmachines).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualmachinesInner> beginCreateOrUpdate( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualmachinesName, virtualmachines, context) + .getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualmachinesName, virtualmachines) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualmachinesName, virtualmachines, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualmachinesInner createOrUpdate( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines) { + return createOrUpdateAsync(resourceGroupName, virtualmachinesName, virtualmachines).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualmachinesInner createOrUpdate( + String resourceGroupName, String virtualmachinesName, VirtualmachinesInner virtualmachines, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualmachinesName, virtualmachines, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String virtualmachinesName) { + 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String virtualmachinesName, 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualmachinesName) { + return deleteWithResponseAsync(resourceGroupName, virtualmachinesName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String virtualmachinesName) { + deleteAsync(resourceGroupName, virtualmachinesName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String virtualmachinesName, Context context) { + return deleteWithResponseAsync(resourceGroupName, virtualmachinesName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String virtualmachinesName, VirtualmachinesPatch virtualmachines) { + 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + if (virtualmachines == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachines is required and cannot be null.")); + } else { + virtualmachines.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + virtualmachines, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String virtualmachinesName, VirtualmachinesPatch virtualmachines, 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + if (virtualmachines == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachines is required and cannot be null.")); + } else { + virtualmachines.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + virtualmachines, + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String virtualmachinesName, VirtualmachinesPatch virtualmachines) { + return updateWithResponseAsync(resourceGroupName, virtualmachinesName, virtualmachines) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource patch definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualmachinesInner update( + String resourceGroupName, String virtualmachinesName, VirtualmachinesPatch virtualmachines) { + return updateAsync(resourceGroupName, virtualmachinesName, virtualmachines).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param virtualmachines The virtualmachines resource patch definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String virtualmachinesName, VirtualmachinesPatch virtualmachines, Context context) { + return updateWithResponseAsync(resourceGroupName, virtualmachinesName, virtualmachines, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String virtualmachinesName) { + 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String virtualmachinesName, 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String virtualmachinesName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, virtualmachinesName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String virtualmachinesName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, virtualmachinesName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String virtualmachinesName) { + return beginStartAsync(resourceGroupName, virtualmachinesName).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String virtualmachinesName, Context context) { + return beginStartAsync(resourceGroupName, virtualmachinesName, context).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String virtualmachinesName) { + return beginStartAsync(resourceGroupName, virtualmachinesName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String virtualmachinesName, Context context) { + return beginStartAsync(resourceGroupName, virtualmachinesName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String virtualmachinesName) { + startAsync(resourceGroupName, virtualmachinesName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String virtualmachinesName, Context context) { + startAsync(resourceGroupName, virtualmachinesName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String virtualmachinesName) { + 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String virtualmachinesName, 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync(String resourceGroupName, String virtualmachinesName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, virtualmachinesName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String virtualmachinesName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(resourceGroupName, virtualmachinesName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String virtualmachinesName) { + return beginStopAsync(resourceGroupName, virtualmachinesName).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String virtualmachinesName, Context context) { + return beginStopAsync(resourceGroupName, virtualmachinesName, context).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String virtualmachinesName) { + return beginStopAsync(resourceGroupName, virtualmachinesName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String virtualmachinesName, Context context) { + return beginStopAsync(resourceGroupName, virtualmachinesName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String virtualmachinesName) { + stopAsync(resourceGroupName, virtualmachinesName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String virtualmachinesName, Context context) { + stopAsync(resourceGroupName, virtualmachinesName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String virtualmachinesName) { + 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String virtualmachinesName, 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 (virtualmachinesName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualmachinesName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualmachinesName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String virtualmachinesName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, virtualmachinesName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String virtualmachinesName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, virtualmachinesName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String virtualmachinesName) { + return beginRestartAsync(resourceGroupName, virtualmachinesName).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String virtualmachinesName, Context context) { + return beginRestartAsync(resourceGroupName, virtualmachinesName, context).getSyncPoller(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String virtualmachinesName) { + return beginRestartAsync(resourceGroupName, virtualmachinesName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String virtualmachinesName, Context context) { + return beginRestartAsync(resourceGroupName, virtualmachinesName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String virtualmachinesName) { + restartAsync(resourceGroupName, virtualmachinesName).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String virtualmachinesName, Context context) { + restartAsync(resourceGroupName, virtualmachinesName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualmachinesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualmachinesOperationsImpl.java new file mode 100644 index 0000000000000..a90c3b0dc0ddb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualmachinesOperationsImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.VirtualmachinesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualmachinesInner; +import com.azure.resourcemanager.azurestackhci.models.Virtualmachines; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesOperations; + +public final class VirtualmachinesOperationsImpl implements VirtualmachinesOperations { + private static final ClientLogger LOGGER = new ClientLogger(VirtualmachinesOperationsImpl.class); + + private final VirtualmachinesOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public VirtualmachinesOperationsImpl( + VirtualmachinesOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Virtualmachines getByResourceGroup(String resourceGroupName, String virtualmachinesName) { + VirtualmachinesInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualmachinesName); + if (inner != null) { + return new VirtualmachinesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualmachinesName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualmachinesName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualmachinesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualmachinesName) { + this.serviceClient().delete(resourceGroupName, virtualmachinesName); + } + + public Response deleteWithResponse(String resourceGroupName, String virtualmachinesName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, virtualmachinesName, context); + } + + public void start(String resourceGroupName, String virtualmachinesName) { + this.serviceClient().start(resourceGroupName, virtualmachinesName); + } + + public void start(String resourceGroupName, String virtualmachinesName, Context context) { + this.serviceClient().start(resourceGroupName, virtualmachinesName, context); + } + + public void stop(String resourceGroupName, String virtualmachinesName) { + this.serviceClient().stop(resourceGroupName, virtualmachinesName); + } + + public void stop(String resourceGroupName, String virtualmachinesName, Context context) { + this.serviceClient().stop(resourceGroupName, virtualmachinesName, context); + } + + public void restart(String resourceGroupName, String virtualmachinesName) { + this.serviceClient().restart(resourceGroupName, virtualmachinesName); + } + + public void restart(String resourceGroupName, String virtualmachinesName, Context context) { + this.serviceClient().restart(resourceGroupName, virtualmachinesName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualmachinesImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualmachinesImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualmachinesImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualmachinesImpl(inner1, this.manager())); + } + + public Virtualmachines getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualmachinesName = Utils.getValueFromIdByName(id, "virtualmachines"); + if (virtualmachinesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualmachines'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualmachinesName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualmachinesName = Utils.getValueFromIdByName(id, "virtualmachines"); + if (virtualmachinesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualmachines'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualmachinesName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualmachinesName = Utils.getValueFromIdByName(id, "virtualmachines"); + if (virtualmachinesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualmachines'.", id))); + } + this.deleteWithResponse(resourceGroupName, virtualmachinesName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualmachinesName = Utils.getValueFromIdByName(id, "virtualmachines"); + if (virtualmachinesName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualmachines'.", id))); + } + return this.deleteWithResponse(resourceGroupName, virtualmachinesName, context); + } + + private VirtualmachinesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public VirtualmachinesImpl define(String name) { + return new VirtualmachinesImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualnetworksImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualnetworksImpl.java new file mode 100644 index 0000000000000..98dbfe4fc3df7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualnetworksImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualnetworksInner; +import com.azure.resourcemanager.azurestackhci.models.Virtualnetworks; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksPatch; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksPropertiesSubnetsItem; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualnetworksImpl implements Virtualnetworks, Virtualnetworks.Definition, Virtualnetworks.Update { + private VirtualnetworksInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VirtualnetworksExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String networkType() { + return this.innerModel().networkType(); + } + + public List subnets() { + List inner = this.innerModel().subnets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public Object status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualnetworksInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualnetworksName; + + private VirtualnetworksPatch updateVirtualnetworks; + + public VirtualnetworksImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Virtualnetworks create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualnetworksOperations() + .createOrUpdate(resourceGroupName, virtualnetworksName, this.innerModel(), Context.NONE); + return this; + } + + public Virtualnetworks create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualnetworksOperations() + .createOrUpdate(resourceGroupName, virtualnetworksName, this.innerModel(), context); + return this; + } + + VirtualnetworksImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new VirtualnetworksInner(); + this.serviceManager = serviceManager; + this.virtualnetworksName = name; + } + + public VirtualnetworksImpl update() { + this.updateVirtualnetworks = new VirtualnetworksPatch(); + return this; + } + + public Virtualnetworks apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualnetworksOperations() + .updateWithResponse(resourceGroupName, virtualnetworksName, updateVirtualnetworks, Context.NONE) + .getValue(); + return this; + } + + public Virtualnetworks apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualnetworksOperations() + .updateWithResponse(resourceGroupName, virtualnetworksName, updateVirtualnetworks, context) + .getValue(); + return this; + } + + VirtualnetworksImpl( + VirtualnetworksInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualnetworksName = Utils.getValueFromIdByName(innerObject.id(), "virtualnetworks"); + } + + public Virtualnetworks refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualnetworksOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualnetworksName, Context.NONE) + .getValue(); + return this; + } + + public Virtualnetworks refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualnetworksOperations() + .getByResourceGroupWithResponse(resourceGroupName, virtualnetworksName, context) + .getValue(); + return this; + } + + public VirtualnetworksImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualnetworksImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualnetworksImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVirtualnetworks.withTags(tags); + return this; + } + } + + public VirtualnetworksImpl withExtendedLocation(VirtualnetworksExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualnetworksImpl withNetworkType(String networkType) { + this.innerModel().withNetworkType(networkType); + return this; + } + + public VirtualnetworksImpl withSubnets(List subnets) { + this.innerModel().withSubnets(subnets); + return this; + } + + public VirtualnetworksImpl withProvisioningState(String provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public VirtualnetworksImpl withResourceName(String resourceName) { + this.innerModel().withResourceName(resourceName); + return this; + } + + public VirtualnetworksImpl withStatus(Object status) { + this.innerModel().withStatus(status); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualnetworksOperationsClientImpl.java similarity index 65% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualnetworksOperationsClientImpl.java index ce30daccae08a..1df00935605c7 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualnetworksOperationsClientImpl.java @@ -27,125 +27,130 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.ClusterList; -import com.azure.resourcemanager.azurestackhci.models.ClusterUpdate; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.VirtualnetworksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualnetworksInner; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksListResult; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksPatch; +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 ClustersClient. */ -public final class ClustersClientImpl implements ClustersClient { - private final ClientLogger logger = new ClientLogger(ClustersClientImpl.class); - +/** An instance of this class provides access to all the operations defined in VirtualnetworksOperationsClient. */ +public final class VirtualnetworksOperationsClientImpl implements VirtualnetworksOperationsClient { /** The proxy service used to perform REST calls. */ - private final ClustersService service; + private final VirtualnetworksOperationsService service; /** The service client containing this operation class. */ private final AzureStackHciClientImpl client; /** - * Initializes an instance of ClustersClientImpl. + * Initializes an instance of VirtualnetworksOperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ClustersClientImpl(AzureStackHciClientImpl client) { - this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + VirtualnetworksOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + VirtualnetworksOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureStackHciClientClusters to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureStackHciClientVirtualnetworksOperations to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureStackHciClientC") - private interface ClustersService { + @ServiceInterface(name = "AzureStackHciClientV") + private interface VirtualnetworksOperationsService { @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters") + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/virtualnetworks/{virtualnetworksName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> getByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualnetworksName") String virtualnetworksName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( + @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters") - @ExpectedResponses({200}) + + "/virtualnetworks/{virtualnetworksName}") + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualnetworksName") String virtualnetworksName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualnetworksInner virtualnetworks, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( + @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") - @ExpectedResponses({200}) + + "/virtualnetworks/{virtualnetworksName}") + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( + Mono> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, + @PathParam("virtualnetworksName") String virtualnetworksName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Put( + @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") - @ExpectedResponses({200}) + + "/virtualnetworks/{virtualnetworksName}") + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( + Mono> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, + @PathParam("virtualnetworksName") String virtualnetworksName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ClusterInner cluster, + @BodyParam("application/json") VirtualnetworksPatch virtualnetworks, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Patch( + @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") + + "/virtualnetworks") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ClusterUpdate cluster, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") - @ExpectedResponses({200, 204}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualnetworks") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -154,7 +159,7 @@ Mono> delete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -164,7 +169,7 @@ Mono> listBySubscriptionNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -172,14 +177,17 @@ Mono> listByResourceGroupNext( } /** - * List all HCI clusters in a subscription. - * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName 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 list of clusters. + * @return the virtualnetworks resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualnetworksName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -192,40 +200,43 @@ private Mono> listSinglePageAsync() { 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 (virtualnetworksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworksName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( + .getByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, + virtualnetworksName, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all HCI clusters in a subscription. - * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName 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 list of clusters. + * @return the virtualnetworks resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualnetworksName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -238,91 +249,89 @@ private Mono> listSinglePageAsync(Context context) { 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 (virtualnetworksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworksName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( + .getByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, + virtualnetworksName, this.client.getApiVersion(), accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all HCI clusters in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + context); } /** - * List all HCI clusters in a subscription. - * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName 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 list of clusters. + * @return the virtualnetworks resource definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualnetworksName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualnetworksName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * List all HCI clusters in a subscription. - * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName 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 list of clusters. + * @return the virtualnetworks resource definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualnetworksInner getByResourceGroup(String resourceGroupName, String virtualnetworksName) { + return getByResourceGroupAsync(resourceGroupName, virtualnetworksName).block(); } /** - * List all HCI clusters in a subscription. - * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName 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 list of clusters. + * @return the virtualnetworks resource definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualnetworksName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualnetworksName, context).block(); } /** - * List all HCI clusters in a resource group. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the virtualnetworks resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -339,43 +348,47 @@ private Mono> listByResourceGroupSinglePageAsync(Str return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (virtualnetworksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworksName is required and cannot be null.")); + } + if (virtualnetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworks is required and cannot be null.")); + } else { + virtualnetworks.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByResourceGroup( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualnetworksName, this.client.getApiVersion(), + virtualnetworks, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all HCI clusters in a resource group. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the virtualnetworks resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -392,102 +405,184 @@ private Mono> listByResourceGroupSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (virtualnetworksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworksName is required and cannot be null.")); + } + if (virtualnetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworks is required and cannot be null.")); + } else { + virtualnetworks.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualnetworksName, this.client.getApiVersion(), + virtualnetworks, accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * List all HCI clusters in a resource group. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the {@link PollerFlux} for polling of the virtualnetworks resource definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualnetworksInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualnetworksName, virtualnetworks); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualnetworksInner.class, + VirtualnetworksInner.class, + this.client.getContext()); } /** - * List all HCI clusters in a resource group. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the {@link PollerFlux} for polling of the virtualnetworks resource definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualnetworksInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualnetworksName, virtualnetworks, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualnetworksInner.class, VirtualnetworksInner.class, context); } /** - * List all HCI clusters in a resource group. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the {@link SyncPoller} for polling of the virtualnetworks resource definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualnetworksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualnetworksName, virtualnetworks).getSyncPoller(); } /** - * List all HCI clusters in a resource group. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the {@link SyncPoller} for polling of the virtualnetworks resource definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualnetworksInner> beginCreateOrUpdate( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualnetworksName, virtualnetworks, context) + .getSyncPoller(); } /** - * Get HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return the virtualnetworks resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String clusterName) { + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualnetworksName, virtualnetworks) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualnetworks resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualnetworksName, virtualnetworks, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualnetworks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualnetworksInner createOrUpdate( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks) { + return createOrUpdateAsync(resourceGroupName, virtualnetworksName, virtualnetworks).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualnetworks resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualnetworksInner createOrUpdate( + String resourceGroupName, String virtualnetworksName, VirtualnetworksInner virtualnetworks, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualnetworksName, virtualnetworks, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String virtualnetworksName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -504,19 +599,20 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (virtualnetworksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworksName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .getByResourceGroup( + .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + virtualnetworksName, this.client.getApiVersion(), accept, context)) @@ -524,19 +620,17 @@ private Mono> getByResourceGroupWithResponseAsync( } /** - * Get HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualnetworksName The virtualnetworksName 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 hCI cluster. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { + private Mono> deleteWithResponseAsync( + String resourceGroupName, String virtualnetworksName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -553,91 +647,76 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (virtualnetworksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworksName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByResourceGroup( + .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + virtualnetworksName, this.client.getApiVersion(), accept, context); } /** - * Get HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualnetworksName The virtualnetworksName 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 hCI cluster. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono deleteAsync(String resourceGroupName, String virtualnetworksName) { + return deleteWithResponseAsync(resourceGroupName, virtualnetworksName) + .flatMap((Response res) -> Mono.empty()); } /** - * Get HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualnetworksName The virtualnetworksName 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 hCI cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + public void delete(String resourceGroupName, String virtualnetworksName) { + deleteAsync(resourceGroupName, virtualnetworksName).block(); } /** - * Get HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param virtualnetworksName The virtualnetworksName 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 hCI cluster. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + public Response deleteWithResponse(String resourceGroupName, String virtualnetworksName, Context context) { + return deleteWithResponseAsync(resourceGroupName, virtualnetworksName, context).block(); } /** - * Create an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the virtualnetworks resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner cluster) { + private Mono> updateWithResponseAsync( + String resourceGroupName, String virtualnetworksName, VirtualnetworksPatch virtualnetworks) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -654,46 +733,47 @@ private Mono> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (virtualnetworksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworksName is required and cannot be null.")); } - if (cluster == null) { - return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + if (virtualnetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworks is required and cannot be null.")); } else { - cluster.validate(); + virtualnetworks.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .create( + .update( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + virtualnetworksName, this.client.getApiVersion(), - cluster, + virtualnetworks, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the virtualnetworks resource definition along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { + private Mono> updateWithResponseAsync( + String resourceGroupName, String virtualnetworksName, VirtualnetworksPatch virtualnetworks, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -710,44 +790,45 @@ private Mono> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + if (virtualnetworksName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworksName is required and cannot be null.")); } - if (cluster == null) { - return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + if (virtualnetworks == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualnetworks is required and cannot be null.")); } else { - cluster.validate(); + virtualnetworks.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .create( + .update( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, + virtualnetworksName, this.client.getApiVersion(), - cluster, + virtualnetworks, accept, context); } /** - * Create an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the virtualnetworks resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String clusterName, ClusterInner cluster) { - return createWithResponseAsync(resourceGroupName, clusterName, cluster) + private Mono updateAsync( + String resourceGroupName, String virtualnetworksName, VirtualnetworksPatch virtualnetworks) { + return updateWithResponseAsync(resourceGroupName, virtualnetworksName, virtualnetworks) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -757,53 +838,45 @@ private Mono createAsync(String resourceGroupName, String clusterN } /** - * Create an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource patch definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the virtualnetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster) { - return createAsync(resourceGroupName, clusterName, cluster).block(); + public VirtualnetworksInner update( + String resourceGroupName, String virtualnetworksName, VirtualnetworksPatch virtualnetworks) { + return updateAsync(resourceGroupName, virtualnetworksName, virtualnetworks).block(); } /** - * Create an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param virtualnetworksName The virtualnetworksName parameter. + * @param virtualnetworks The virtualnetworks resource patch definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the virtualnetworks resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { - return createWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + public Response updateWithResponse( + String resourceGroupName, String virtualnetworksName, VirtualnetworksPatch virtualnetworks, Context context) { + return updateWithResponseAsync(resourceGroupName, virtualnetworksName, virtualnetworks, context).block(); } /** - * Update an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterUpdate cluster) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -820,46 +893,41 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (cluster == null) { - return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); - } else { - cluster.validate(); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .update( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), - cluster, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterUpdate cluster, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -876,98 +944,88 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (cluster == null) { - return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); - } else { - cluster.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .update( + .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), - cluster, accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Update an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, ClusterUpdate cluster) { - return updateWithResponseAsync(resourceGroupName, clusterName, cluster) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Update an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdate cluster) { - return updateAsync(resourceGroupName, clusterName, cluster).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Update an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterUpdate cluster, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Delete an HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -980,43 +1038,38 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete an HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1029,69 +1082,70 @@ private Mono> deleteWithResponseAsync( 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, - clusterName, this.client.getApiVersion(), accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Delete an HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName) { - return deleteWithResponseAsync(resourceGroupName, clusterName).flatMap((Response res) -> Mono.empty()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Delete an HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName) { - deleteAsync(resourceGroupName, clusterName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); } /** - * Delete an HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { - return deleteWithResponseAsync(resourceGroupName, clusterName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** @@ -1101,10 +1155,10 @@ public Response deleteWithResponse(String resourceGroupName, String cluste * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1117,8 +1171,8 @@ private Mono> listBySubscriptionNextSinglePageAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1138,10 +1192,11 @@ private Mono> listBySubscriptionNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1154,7 +1209,7 @@ private Mono> listBySubscriptionNextSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1173,10 +1228,10 @@ private Mono> listBySubscriptionNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1189,8 +1244,8 @@ private Mono> listByResourceGroupNextSinglePageAsync final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1210,10 +1265,11 @@ private Mono> listByResourceGroupNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1226,7 +1282,7 @@ private Mono> listByResourceGroupNextSinglePageAsync final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualnetworksOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualnetworksOperationsImpl.java new file mode 100644 index 0000000000000..4fc2d9e3b564c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/VirtualnetworksOperationsImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.azurestackhci.fluent.VirtualnetworksOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualnetworksInner; +import com.azure.resourcemanager.azurestackhci.models.Virtualnetworks; +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksOperations; + +public final class VirtualnetworksOperationsImpl implements VirtualnetworksOperations { + private static final ClientLogger LOGGER = new ClientLogger(VirtualnetworksOperationsImpl.class); + + private final VirtualnetworksOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public VirtualnetworksOperationsImpl( + VirtualnetworksOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Virtualnetworks getByResourceGroup(String resourceGroupName, String virtualnetworksName) { + VirtualnetworksInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualnetworksName); + if (inner != null) { + return new VirtualnetworksImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualnetworksName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualnetworksName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualnetworksImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualnetworksName) { + this.serviceClient().delete(resourceGroupName, virtualnetworksName); + } + + public Response deleteWithResponse(String resourceGroupName, String virtualnetworksName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, virtualnetworksName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualnetworksImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualnetworksImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualnetworksImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualnetworksImpl(inner1, this.manager())); + } + + public Virtualnetworks getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualnetworksName = Utils.getValueFromIdByName(id, "virtualnetworks"); + if (virtualnetworksName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualnetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualnetworksName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualnetworksName = Utils.getValueFromIdByName(id, "virtualnetworks"); + if (virtualnetworksName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualnetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualnetworksName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualnetworksName = Utils.getValueFromIdByName(id, "virtualnetworks"); + if (virtualnetworksName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualnetworks'.", id))); + } + this.deleteWithResponse(resourceGroupName, virtualnetworksName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualnetworksName = Utils.getValueFromIdByName(id, "virtualnetworks"); + if (virtualnetworksName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualnetworks'.", id))); + } + return this.deleteWithResponse(resourceGroupName, virtualnetworksName, context); + } + + private VirtualnetworksOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public VirtualnetworksImpl define(String name) { + return new VirtualnetworksImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java new file mode 100644 index 0000000000000..5affedfda7875 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** @return known ActionType values. */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailableOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailableOperations.java deleted file mode 100644 index f34dac121ea0f..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailableOperations.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; -import java.util.List; - -/** An immutable client-side representation of AvailableOperations. */ -public interface AvailableOperations { - /** - * Gets the value property: Collection of available operation details. - * - * @return the value value. - */ - List value(); - - /** - * Gets the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for - * now, added for future use. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner object. - * - * @return the inner object. - */ - AvailableOperationsInner innerModel(); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java deleted file mode 100644 index 9465d92f22429..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java +++ /dev/null @@ -1,412 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of Cluster. */ -public interface Cluster { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the provisioningState property: Provisioning state. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the status property: Status of the cluster agent. - * - * @return the status value. - */ - Status status(); - - /** - * Gets the cloudId property: Unique, immutable resource id. - * - * @return the cloudId value. - */ - String cloudId(); - - /** - * Gets the aadClientId property: App id of cluster AAD identity. - * - * @return the aadClientId value. - */ - String aadClientId(); - - /** - * Gets the aadTenantId property: Tenant id of cluster AAD identity. - * - * @return the aadTenantId value. - */ - String aadTenantId(); - - /** - * Gets the reportedProperties property: Properties reported by cluster agent. - * - * @return the reportedProperties value. - */ - ClusterReportedProperties reportedProperties(); - - /** - * Gets the trialDaysRemaining property: Number of days remaining in the trial period. - * - * @return the trialDaysRemaining value. - */ - Float trialDaysRemaining(); - - /** - * Gets the billingModel property: Type of billing applied to the resource. - * - * @return the billingModel value. - */ - String billingModel(); - - /** - * Gets the registrationTimestamp property: First cluster sync timestamp. - * - * @return the registrationTimestamp value. - */ - OffsetDateTime registrationTimestamp(); - - /** - * Gets the lastSyncTimestamp property: Most recent cluster sync timestamp. - * - * @return the lastSyncTimestamp value. - */ - OffsetDateTime lastSyncTimestamp(); - - /** - * Gets the lastBillingTimestamp property: Most recent billing meter timestamp. - * - * @return the lastBillingTimestamp value. - */ - OffsetDateTime lastBillingTimestamp(); - - /** - * Gets the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - String createdBy(); - - /** - * Gets the createdByType property: The type of identity that created the resource. - * - * @return the createdByType value. - */ - CreatedByType createdByType(); - - /** - * Gets the createdAt property: The timestamp of resource creation (UTC). - * - * @return the createdAt value. - */ - OffsetDateTime createdAt(); - - /** - * Gets the lastModifiedBy property: The identity that last modified the resource. - * - * @return the lastModifiedBy value. - */ - String lastModifiedBy(); - - /** - * Gets the lastModifiedByType property: The type of identity that last modified the resource. - * - * @return the lastModifiedByType value. - */ - CreatedByType lastModifiedByType(); - - /** - * Gets the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @return the lastModifiedAt value. - */ - OffsetDateTime lastModifiedAt(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner object. - * - * @return the inner object. - */ - ClusterInner innerModel(); - - /** The entirety of the Cluster definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The Cluster definition stages. */ - interface DefinitionStages { - /** The first stage of the Cluster definition. */ - interface Blank extends WithLocation { - } - /** The stage of the Cluster definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - /** The stage of the Cluster definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the Cluster 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.WithAadClientId, - DefinitionStages.WithAadTenantId, - DefinitionStages.WithReportedProperties, - DefinitionStages.WithCreatedBy, - DefinitionStages.WithCreatedByType, - DefinitionStages.WithCreatedAt, - DefinitionStages.WithLastModifiedBy, - DefinitionStages.WithLastModifiedByType, - DefinitionStages.WithLastModifiedAt { - /** - * Executes the create request. - * - * @return the created resource. - */ - Cluster create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Cluster create(Context context); - } - /** The stage of the Cluster definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - /** The stage of the Cluster definition allowing to specify aadClientId. */ - interface WithAadClientId { - /** - * Specifies the aadClientId property: App id of cluster AAD identity.. - * - * @param aadClientId App id of cluster AAD identity. - * @return the next definition stage. - */ - WithCreate withAadClientId(String aadClientId); - } - /** The stage of the Cluster definition allowing to specify aadTenantId. */ - interface WithAadTenantId { - /** - * Specifies the aadTenantId property: Tenant id of cluster AAD identity.. - * - * @param aadTenantId Tenant id of cluster AAD identity. - * @return the next definition stage. - */ - WithCreate withAadTenantId(String aadTenantId); - } - /** The stage of the Cluster definition allowing to specify reportedProperties. */ - interface WithReportedProperties { - /** - * Specifies the reportedProperties property: Properties reported by cluster agent.. - * - * @param reportedProperties Properties reported by cluster agent. - * @return the next definition stage. - */ - WithCreate withReportedProperties(ClusterReportedProperties reportedProperties); - } - /** The stage of the Cluster definition allowing to specify createdBy. */ - interface WithCreatedBy { - /** - * Specifies the createdBy property: The identity that created the resource.. - * - * @param createdBy The identity that created the resource. - * @return the next definition stage. - */ - WithCreate withCreatedBy(String createdBy); - } - /** The stage of the Cluster definition allowing to specify createdByType. */ - interface WithCreatedByType { - /** - * Specifies the createdByType property: The type of identity that created the resource.. - * - * @param createdByType The type of identity that created the resource. - * @return the next definition stage. - */ - WithCreate withCreatedByType(CreatedByType createdByType); - } - /** The stage of the Cluster definition allowing to specify createdAt. */ - interface WithCreatedAt { - /** - * Specifies the createdAt property: The timestamp of resource creation (UTC).. - * - * @param createdAt The timestamp of resource creation (UTC). - * @return the next definition stage. - */ - WithCreate withCreatedAt(OffsetDateTime createdAt); - } - /** The stage of the Cluster definition allowing to specify lastModifiedBy. */ - interface WithLastModifiedBy { - /** - * Specifies the lastModifiedBy property: The identity that last modified the resource.. - * - * @param lastModifiedBy The identity that last modified the resource. - * @return the next definition stage. - */ - WithCreate withLastModifiedBy(String lastModifiedBy); - } - /** The stage of the Cluster definition allowing to specify lastModifiedByType. */ - interface WithLastModifiedByType { - /** - * Specifies the lastModifiedByType property: The type of identity that last modified the resource.. - * - * @param lastModifiedByType The type of identity that last modified the resource. - * @return the next definition stage. - */ - WithCreate withLastModifiedByType(CreatedByType lastModifiedByType); - } - /** The stage of the Cluster definition allowing to specify lastModifiedAt. */ - interface WithLastModifiedAt { - /** - * Specifies the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @param lastModifiedAt The timestamp of resource last modification (UTC). - * @return the next definition stage. - */ - WithCreate withLastModifiedAt(OffsetDateTime lastModifiedAt); - } - } - /** - * Begins update for the Cluster resource. - * - * @return the stage of resource update. - */ - Cluster.Update update(); - - /** The template for Cluster update. */ - interface Update extends UpdateStages.WithTags { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Cluster apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Cluster apply(Context context); - } - /** The Cluster update stages. */ - interface UpdateStages { - /** The stage of the Cluster update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Cluster refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Cluster refresh(Context context); -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java deleted file mode 100644 index c755566c5e9fa..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.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; - -/** Cluster node details. */ -@Immutable -public final class ClusterNode { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterNode.class); - - /* - * Name of the cluster node. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Id of the node in the cluster. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private Float id; - - /* - * Manufacturer of the cluster node hardware. - */ - @JsonProperty(value = "manufacturer", access = JsonProperty.Access.WRITE_ONLY) - private String manufacturer; - - /* - * Model name of the cluster node hardware. - */ - @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) - private String model; - - /* - * Operating system running on the cluster node. - */ - @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) - private String osName; - - /* - * Version of the operating system running on the cluster node. - */ - @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) - private String osVersion; - - /* - * Immutable id of the cluster node. - */ - @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) - private String serialNumber; - - /* - * Number of physical cores on the cluster node. - */ - @JsonProperty(value = "coreCount", access = JsonProperty.Access.WRITE_ONLY) - private Float coreCount; - - /* - * Total available memory on the cluster node (in GiB). - */ - @JsonProperty(value = "memoryInGiB", access = JsonProperty.Access.WRITE_ONLY) - private Float memoryInGiB; - - /** - * Get the name property: Name of the cluster node. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the id property: Id of the node in the cluster. - * - * @return the id value. - */ - public Float id() { - return this.id; - } - - /** - * Get the manufacturer property: Manufacturer of the cluster node hardware. - * - * @return the manufacturer value. - */ - public String manufacturer() { - return this.manufacturer; - } - - /** - * Get the model property: Model name of the cluster node hardware. - * - * @return the model value. - */ - public String model() { - return this.model; - } - - /** - * Get the osName property: Operating system running on the cluster node. - * - * @return the osName value. - */ - public String osName() { - return this.osName; - } - - /** - * Get the osVersion property: Version of the operating system running on the cluster node. - * - * @return the osVersion value. - */ - public String osVersion() { - return this.osVersion; - } - - /** - * Get the serialNumber property: Immutable id of the cluster node. - * - * @return the serialNumber value. - */ - public String serialNumber() { - return this.serialNumber; - } - - /** - * Get the coreCount property: Number of physical cores on the cluster node. - * - * @return the coreCount value. - */ - public Float coreCount() { - return this.coreCount; - } - - /** - * Get the memoryInGiB property: Total available memory on the cluster node (in GiB). - * - * @return the memoryInGiB value. - */ - public Float memoryInGiB() { - return this.memoryInGiB; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java deleted file mode 100644 index 57e55b370e17e..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.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.time.OffsetDateTime; -import java.util.List; - -/** Properties reported by cluster agent. */ -@Immutable -public final class ClusterReportedProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterReportedProperties.class); - - /* - * Name of the on-prem cluster connected to this resource. - */ - @JsonProperty(value = "clusterName", access = JsonProperty.Access.WRITE_ONLY) - private String clusterName; - - /* - * Unique id generated by the on-prem cluster. - */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) - private String clusterId; - - /* - * Version of the cluster software. - */ - @JsonProperty(value = "clusterVersion", access = JsonProperty.Access.WRITE_ONLY) - private String clusterVersion; - - /* - * List of nodes reported by the cluster. - */ - @JsonProperty(value = "nodes", access = JsonProperty.Access.WRITE_ONLY) - private List nodes; - - /* - * Last time the cluster reported the data. - */ - @JsonProperty(value = "lastUpdated", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdated; - - /** - * Get the clusterName property: Name of the on-prem cluster connected to this resource. - * - * @return the clusterName value. - */ - public String clusterName() { - return this.clusterName; - } - - /** - * Get the clusterId property: Unique id generated by the on-prem cluster. - * - * @return the clusterId value. - */ - public String clusterId() { - return this.clusterId; - } - - /** - * Get the clusterVersion property: Version of the cluster software. - * - * @return the clusterVersion value. - */ - public String clusterVersion() { - return this.clusterVersion; - } - - /** - * Get the nodes property: List of nodes reported by the cluster. - * - * @return the nodes value. - */ - public List nodes() { - return this.nodes; - } - - /** - * Get the lastUpdated property: Last time the cluster reported the data. - * - * @return the lastUpdated value. - */ - public OffsetDateTime lastUpdated() { - return this.lastUpdated; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (nodes() != null) { - nodes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable.java new file mode 100644 index 0000000000000..5c5d42db07fa6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RouteTable for the subnet. */ +@Fluent +public final class ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable { + /* + * Etag - Gets a unique read-only string that changes whenever the resource + * is updated. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name - READ-ONLY; Resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * RouteTablePropertiesFormat route Table resource. + */ + @JsonProperty(value = "properties") + private ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties + innerProperties; + + /* + * Type - READ-ONLY; Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the id property: Etag - Gets a unique read-only string that changes whenever the resource is updated. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Etag - Gets a unique read-only string that changes whenever the resource is updated. + * + * @param id the id value to set. + * @return the ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable object + * itself. + */ + public ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable withId( + String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name - READ-ONLY; Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name - READ-ONLY; Resource name. + * + * @param name the name value to set. + * @return the ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable object + * itself. + */ + public ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable withName( + String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: RouteTablePropertiesFormat route Table resource. + * + * @return the innerProperties value. + */ + private ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties + innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: Type - READ-ONLY; Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type - READ-ONLY; Resource type. + * + * @param type the type value to set. + * @return the ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable object + * itself. + */ + public ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable withType( + String type) { + this.type = type; + return this; + } + + /** + * Get the routes property: Routes - Collection of routes contained within a route table. + * + * @return the routes value. + */ + public List routes() { + return this.innerProperties() == null ? null : this.innerProperties().routes(); + } + + /** + * Set the routes property: Routes - Collection of routes contained within a route table. + * + * @param routes the routes value to set. + * @return the ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable object + * itself. + */ + public ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable withRoutes( + List routes) { + if (this.innerProperties() == null) { + this.innerProperties = + new ComponentsOycd2YSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetableProperties(); + } + this.innerProperties().withRoutes(routes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems.java new file mode 100644 index 0000000000000..66cb4546dec6f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IPConfigurationReference - Describes a IPConfiguration under the virtual network. */ +@Fluent +public final +class ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems { + /* + * IPConfigurationID + */ + @JsonProperty(value = "ID") + private String id; + + /** + * Get the id property: IPConfigurationID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: IPConfigurationID. + * + * @param id the id value to set. + * @return the + * ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems + * object itself. + */ + public + ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems + withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CreatedByType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CreatedByType.java deleted file mode 100644 index 71527757128d5..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CreatedByType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CreatedByType. */ -public final class CreatedByType extends ExpandableStringEnum { - /** Static value User for CreatedByType. */ - public static final CreatedByType USER = fromString("User"); - - /** Static value Application for CreatedByType. */ - public static final CreatedByType APPLICATION = fromString("Application"); - - /** Static value ManagedIdentity for CreatedByType. */ - public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** Static value Key for CreatedByType. */ - public static final CreatedByType KEY = fromString("Key"); - - /** - * Creates or finds a CreatedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreatedByType. - */ - @JsonCreator - public static CreatedByType fromString(String name) { - return fromString(name, CreatedByType.class); - } - - /** @return known CreatedByType values. */ - public static Collection values() { - return values(CreatedByType.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Galleryimages.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Galleryimages.java new file mode 100644 index 0000000000000..382d1a03c2695 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Galleryimages.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryimagesInner; +import java.util.Map; + +/** An immutable client-side representation of Galleryimages. */ +public interface Galleryimages { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + GalleryimagesExtendedLocation extendedLocation(); + + /** + * Gets the containerName property: Container Name for storage container. + * + * @return the containerName value. + */ + String containerName(); + + /** + * Gets the imagePath property: location of the image the gallery image should be created from. + * + * @return the imagePath value. + */ + String imagePath(); + + /** + * Gets the osType property: operating system type that the gallery image uses. Expected to be linux or windows. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the provisioningState property: Provisioning state of the gallery image. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the status property: MOCGalleryImageStatus defines the observed state of MOCGalleryImage. + * + * @return the status value. + */ + Object status(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.GalleryimagesInner object. + * + * @return the inner object. + */ + GalleryimagesInner innerModel(); + + /** The entirety of the Galleryimages definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Galleryimages definition stages. */ + interface DefinitionStages { + /** The first stage of the Galleryimages definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Galleryimages definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Galleryimages definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Galleryimages 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.WithExtendedLocation, + DefinitionStages.WithContainerName, + DefinitionStages.WithImagePath, + DefinitionStages.WithOsType, + DefinitionStages.WithProvisioningState, + DefinitionStages.WithResourceName, + DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + Galleryimages create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Galleryimages create(Context context); + } + /** The stage of the Galleryimages definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Galleryimages definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation of the resource.. + * + * @param extendedLocation The extendedLocation of the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(GalleryimagesExtendedLocation extendedLocation); + } + /** The stage of the Galleryimages definition allowing to specify containerName. */ + interface WithContainerName { + /** + * Specifies the containerName property: Container Name for storage container. + * + * @param containerName Container Name for storage container. + * @return the next definition stage. + */ + WithCreate withContainerName(String containerName); + } + /** The stage of the Galleryimages definition allowing to specify imagePath. */ + interface WithImagePath { + /** + * Specifies the imagePath property: location of the image the gallery image should be created from. + * + * @param imagePath location of the image the gallery image should be created from. + * @return the next definition stage. + */ + WithCreate withImagePath(String imagePath); + } + /** The stage of the Galleryimages definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: operating system type that the gallery image uses. Expected to be linux or + * windows. + * + * @param osType operating system type that the gallery image uses. Expected to be linux or windows. + * @return the next definition stage. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + /** The stage of the Galleryimages definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the gallery image.. + * + * @param provisioningState Provisioning state of the gallery image. + * @return the next definition stage. + */ + WithCreate withProvisioningState(String provisioningState); + } + /** The stage of the Galleryimages definition allowing to specify resourceName. */ + interface WithResourceName { + /** + * Specifies the resourceName property: name of the object to be used in moc. + * + * @param resourceName name of the object to be used in moc. + * @return the next definition stage. + */ + WithCreate withResourceName(String resourceName); + } + /** The stage of the Galleryimages definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: MOCGalleryImageStatus defines the observed state of MOCGalleryImage. + * + * @param status MOCGalleryImageStatus defines the observed state of MOCGalleryImage. + * @return the next definition stage. + */ + WithCreate withStatus(Object status); + } + } + /** + * Begins update for the Galleryimages resource. + * + * @return the stage of resource update. + */ + Galleryimages.Update update(); + + /** The template for Galleryimages update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Galleryimages apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Galleryimages apply(Context context); + } + /** The Galleryimages update stages. */ + interface UpdateStages { + /** The stage of the Galleryimages update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Galleryimages refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Galleryimages refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesExtendedLocation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesExtendedLocation.java new file mode 100644 index 0000000000000..6c0bf30588320 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesExtendedLocation.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The extendedLocation of the resource. */ +@Fluent +public final class GalleryimagesExtendedLocation { + /* + * The extended location type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The extended location name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The extended location type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The extended location type. + * + * @param type the type value to set. + * @return the GalleryimagesExtendedLocation object itself. + */ + public GalleryimagesExtendedLocation withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: The extended location name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The extended location name. + * + * @param name the name value to set. + * @return the GalleryimagesExtendedLocation object itself. + */ + public GalleryimagesExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesListResult.java similarity index 65% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesListResult.java index afc2f0fd03dae..92f1cadfbba9d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesListResult.java @@ -5,22 +5,18 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.azurestackhci.fluent.models.GalleryimagesInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of clusters. */ +/** List of galleryimages. */ @Fluent -public final class ClusterList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterList.class); - +public final class GalleryimagesListResult { /* - * List of clusters. + * The value property. */ @JsonProperty(value = "value") - private List value; + private List value; /* * Link to the next set of results. @@ -29,21 +25,21 @@ public final class ClusterList { private String nextLink; /** - * Get the value property: List of clusters. + * Get the value property: The value property. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: List of clusters. + * Set the value property: The value property. * * @param value the value value to set. - * @return the ClusterList object itself. + * @return the GalleryimagesListResult object itself. */ - public ClusterList withValue(List value) { + public GalleryimagesListResult withValue(List value) { this.value = value; return this; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesOperations.java similarity index 57% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesOperations.java index b1023e2021f41..5abf6064b5701 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesOperations.java @@ -2,176 +2,157 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.azurestackhci.fluent; +package com.azure.resourcemanager.azurestackhci.models; -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.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.ClusterUpdate; -/** An instance of this class provides access to all the operations defined in ClustersClient. */ -public interface ClustersClient { +/** Resource collection API of GalleryimagesOperations. */ +public interface GalleryimagesOperations { /** - * List all HCI clusters in a subscription. + * Lists all galleryimages under the resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the galleryimages resource definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + Galleryimages getByResourceGroup(String resourceGroupName, String galleryimagesName); /** - * List all HCI clusters in a subscription. + * Lists all galleryimages under the resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the galleryimages resource definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryimagesName, Context context); /** - * List all HCI clusters in a resource group. + * Delete a galleryimage. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + void deleteByResourceGroup(String resourceGroupName, String galleryimagesName); /** - * List all HCI clusters in a resource group. + * Delete a galleryimage. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryimagesName Name of the gallery image. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + Response deleteWithResponse(String resourceGroupName, String galleryimagesName, Context context); /** - * Get HCI cluster. + * Lists all galleryimages under the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return list of galleryimages as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get HCI cluster. + * Lists all galleryimages under the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @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 hCI cluster. + * @return list of galleryimages as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Create an HCI cluster. + * List all galleryimages under the subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return list of galleryimages as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster); + PagedIterable list(); /** - * Create an HCI cluster. + * List all galleryimages under the subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. * @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 cluster details. + * @return list of galleryimages as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context); + PagedIterable list(Context context); /** - * Update an HCI cluster. + * Lists all galleryimages under the resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the galleryimages resource definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdate cluster); + Galleryimages getById(String id); /** - * Update an HCI cluster. + * Lists all galleryimages under the resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param cluster Details of the HCI cluster. + * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return the galleryimages resource definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterUpdate cluster, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Delete an HCI cluster. + * Delete a galleryimage. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName); + void deleteById(String id); /** - * Delete an HCI cluster. + * Delete a galleryimage. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. + * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Galleryimages resource. + * + * @param name resource name. + * @return the first stage of the new Galleryimages definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String clusterName, Context context); + Galleryimages.DefinitionStages.Blank define(String name); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesPatch.java similarity index 70% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterUpdate.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesPatch.java index 9f56919c75a24..34bc6582a59c4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterUpdate.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/GalleryimagesPatch.java @@ -5,20 +5,18 @@ package com.azure.resourcemanager.azurestackhci.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; -/** Cluster details to update. */ +/** The galleryimages resource patch definition. */ @Fluent -public final class ClusterUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpdate.class); - +public final class GalleryimagesPatch { /* - * Resource tags. + * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -34,9 +32,9 @@ public Map tags() { * Set the tags property: Resource tags. * * @param tags the tags value to set. - * @return the ClusterUpdate object itself. + * @return the GalleryimagesPatch object itself. */ - public ClusterUpdate withTags(Map tags) { + public GalleryimagesPatch withTags(Map tags) { this.tags = tags; return this; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HardwareProfileUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HardwareProfileUpdate.java new file mode 100644 index 0000000000000..ef3cd974c2086 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HardwareProfileUpdate.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HardwareProfile - Specifies the hardware settings for the virtual machine. */ +@Fluent +public final class HardwareProfileUpdate { + /* + * The vmSize property. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /* + * number of processors for the virtual machine + */ + @JsonProperty(value = "processors") + private Integer processors; + + /* + * RAM in gb for the virtual machine + */ + @JsonProperty(value = "memoryGB") + private Integer memoryGB; + + /** + * Get the vmSize property: The vmSize property. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The vmSize property. + * + * @param vmSize the vmSize value to set. + * @return the HardwareProfileUpdate object itself. + */ + public HardwareProfileUpdate withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the processors property: number of processors for the virtual machine. + * + * @return the processors value. + */ + public Integer processors() { + return this.processors; + } + + /** + * Set the processors property: number of processors for the virtual machine. + * + * @param processors the processors value to set. + * @return the HardwareProfileUpdate object itself. + */ + public HardwareProfileUpdate withProcessors(Integer processors) { + this.processors = processors; + return this; + } + + /** + * Get the memoryGB property: RAM in gb for the virtual machine. + * + * @return the memoryGB value. + */ + public Integer memoryGB() { + return this.memoryGB; + } + + /** + * Set the memoryGB property: RAM in gb for the virtual machine. + * + * @param memoryGB the memoryGB value to set. + * @return the HardwareProfileUpdate object itself. + */ + public HardwareProfileUpdate withMemoryGB(Integer memoryGB) { + this.memoryGB = memoryGB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InterfaceDnsSettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InterfaceDnsSettings.java new file mode 100644 index 0000000000000..bfd64ba75ea6b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/InterfaceDnsSettings.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The InterfaceDnsSettings model. */ +@Fluent +public final class InterfaceDnsSettings { + /* + * List of DNS server IP Addresses for the interface + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the dnsServers property: List of DNS server IP Addresses for the interface. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: List of DNS server IP Addresses for the interface. + * + * @param dnsServers the dnsServers value to set. + * @return the InterfaceDnsSettings object itself. + */ + public InterfaceDnsSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfiguration.java new file mode 100644 index 0000000000000..d11ce27b33d90 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfiguration.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InterfaceIPConfiguration iPConfiguration in a network interface. */ +@Fluent +public final class IpConfiguration { + /* + * Name - The name of the resource that is unique within a resource group. + * This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + */ + @JsonProperty(value = "properties") + private IpConfigurationProperties properties; + + /** + * Get the name property: Name - The name of the resource that is unique within a resource group. This name can be + * used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name - The name of the resource that is unique within a resource group. This name can be + * used to access the resource. + * + * @param name the name value to set. + * @return the IpConfiguration object itself. + */ + public IpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + * + * @return the properties value. + */ + public IpConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + * + * @param properties the properties value to set. + * @return the IpConfiguration object itself. + */ + public IpConfiguration withProperties(IpConfigurationProperties 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationProperties.java new file mode 100644 index 0000000000000..f78de8b7fdda3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationProperties.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** InterfaceIPConfigurationPropertiesFormat properties of IP configuration. */ +@Fluent +public final class IpConfigurationProperties { + /* + * Gateway for network interface + */ + @JsonProperty(value = "gateway") + private String gateway; + + /* + * prefixLength for network interface + */ + @JsonProperty(value = "prefixLength") + private String prefixLength; + + /* + * PrivateIPAddress - Private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * PrivateIPAllocationMethod - The private IP address allocation method. + * Possible values include: 'Static', 'Dynamic' + */ + @JsonProperty(value = "privateIPAllocationMethod") + private String privateIpAllocationMethod; + + /* + * Subnet - Name of Subnet bound to the IP configuration. + */ + @JsonProperty(value = "subnet") + private IpConfigurationPropertiesSubnet subnet; + + /** + * Get the gateway property: Gateway for network interface. + * + * @return the gateway value. + */ + public String gateway() { + return this.gateway; + } + + /** + * Set the gateway property: Gateway for network interface. + * + * @param gateway the gateway value to set. + * @return the IpConfigurationProperties object itself. + */ + public IpConfigurationProperties withGateway(String gateway) { + this.gateway = gateway; + return this; + } + + /** + * Get the prefixLength property: prefixLength for network interface. + * + * @return the prefixLength value. + */ + public String prefixLength() { + return this.prefixLength; + } + + /** + * Set the prefixLength property: prefixLength for network interface. + * + * @param prefixLength the prefixLength value to set. + * @return the IpConfigurationProperties object itself. + */ + public IpConfigurationProperties withPrefixLength(String prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Get the privateIpAddress property: PrivateIPAddress - Private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: PrivateIPAddress - Private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the IpConfigurationProperties object itself. + */ + public IpConfigurationProperties withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: PrivateIPAllocationMethod - The private IP address allocation method. + * Possible values include: 'Static', 'Dynamic'. + * + * @return the privateIpAllocationMethod value. + */ + public String privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: PrivateIPAllocationMethod - The private IP address allocation method. + * Possible values include: 'Static', 'Dynamic'. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the IpConfigurationProperties object itself. + */ + public IpConfigurationProperties withPrivateIpAllocationMethod(String privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnet property: Subnet - Name of Subnet bound to the IP configuration. + * + * @return the subnet value. + */ + public IpConfigurationPropertiesSubnet subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Subnet - Name of Subnet bound to the IP configuration. + * + * @param subnet the subnet value to set. + * @return the IpConfigurationProperties object itself. + */ + public IpConfigurationProperties withSubnet(IpConfigurationPropertiesSubnet subnet) { + this.subnet = subnet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationPropertiesSubnet.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationPropertiesSubnet.java new file mode 100644 index 0000000000000..097e1c0ccbd4a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpConfigurationPropertiesSubnet.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Subnet - Name of Subnet bound to the IP configuration. */ +@Fluent +public final class IpConfigurationPropertiesSubnet { + /* + * ID - The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: ID - The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID - The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param id the id value to set. + * @return the IpConfigurationPropertiesSubnet object itself. + */ + public IpConfigurationPropertiesSubnet withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPool.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPool.java new file mode 100644 index 0000000000000..3089b93d782e1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPool.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IpPool model. */ +@Fluent +public final class IpPool { + /* + * ip pool type + */ + @JsonProperty(value = "ipPoolType") + private IpPoolTypeEnum ipPoolType; + + /* + * start of the ip address pool + */ + @JsonProperty(value = "start") + private String start; + + /* + * end of the ip address pool + */ + @JsonProperty(value = "end") + private String end; + + /* + * The info property. + */ + @JsonProperty(value = "info") + private IpPoolInfo info; + + /** + * Get the ipPoolType property: ip pool type. + * + * @return the ipPoolType value. + */ + public IpPoolTypeEnum ipPoolType() { + return this.ipPoolType; + } + + /** + * Set the ipPoolType property: ip pool type. + * + * @param ipPoolType the ipPoolType value to set. + * @return the IpPool object itself. + */ + public IpPool withIpPoolType(IpPoolTypeEnum ipPoolType) { + this.ipPoolType = ipPoolType; + return this; + } + + /** + * Get the start property: start of the ip address pool. + * + * @return the start value. + */ + public String start() { + return this.start; + } + + /** + * Set the start property: start of the ip address pool. + * + * @param start the start value to set. + * @return the IpPool object itself. + */ + public IpPool withStart(String start) { + this.start = start; + return this; + } + + /** + * Get the end property: end of the ip address pool. + * + * @return the end value. + */ + public String end() { + return this.end; + } + + /** + * Set the end property: end of the ip address pool. + * + * @param end the end value to set. + * @return the IpPool object itself. + */ + public IpPool withEnd(String end) { + this.end = end; + return this; + } + + /** + * Get the info property: The info property. + * + * @return the info value. + */ + public IpPoolInfo info() { + return this.info; + } + + /** + * Set the info property: The info property. + * + * @param info the info value to set. + * @return the IpPool object itself. + */ + public IpPool withInfo(IpPoolInfo info) { + this.info = info; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (info() != null) { + info().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolInfo.java new file mode 100644 index 0000000000000..f3ab3c3cf5fa5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolInfo.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.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IpPoolInfo model. */ +@Immutable +public final class IpPoolInfo { + /* + * no. of ip addresses allocated from the ip pool + */ + @JsonProperty(value = "used", access = JsonProperty.Access.WRITE_ONLY) + private String used; + + /* + * no. of ip addresses available in the ip pool + */ + @JsonProperty(value = "available", access = JsonProperty.Access.WRITE_ONLY) + private String available; + + /** + * Get the used property: no. of ip addresses allocated from the ip pool. + * + * @return the used value. + */ + public String used() { + return this.used; + } + + /** + * Get the available property: no. of ip addresses available in the ip pool. + * + * @return the available value. + */ + public String available() { + return this.available; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolTypeEnum.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolTypeEnum.java new file mode 100644 index 0000000000000..b4ceac25a2acf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IpPoolTypeEnum.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.azurestackhci.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for IpPoolTypeEnum. */ +public enum IpPoolTypeEnum { + /** Enum value vm. */ + VM("vm"), + + /** Enum value vippool. */ + VIPPOOL("vippool"); + + /** The actual serialized value for a IpPoolTypeEnum instance. */ + private final String value; + + IpPoolTypeEnum(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IpPoolTypeEnum instance. + * + * @param value the serialized value to parse. + * @return the parsed IpPoolTypeEnum object, or null if unable to parse. + */ + @JsonCreator + public static IpPoolTypeEnum fromString(String value) { + IpPoolTypeEnum[] items = IpPoolTypeEnum.values(); + for (IpPoolTypeEnum item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdate.java new file mode 100644 index 0000000000000..5aced97ae8552 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdate.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkProfile - describes the network update configuration the virtual machine. */ +@Fluent +public final class NetworkProfileUpdate { + /* + * NetworkInterfaces - list of network interfaces to be attached to the + * virtual machine + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get the networkInterfaces property: NetworkInterfaces - list of network interfaces to be attached to the virtual + * machine. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: NetworkInterfaces - list of network interfaces to be attached to the virtual + * machine. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkProfileUpdate object itself. + */ + public NetworkProfileUpdate withNetworkInterfaces( + List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdateNetworkInterfacesItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdateNetworkInterfacesItem.java new file mode 100644 index 0000000000000..011981599fc89 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkProfileUpdateNetworkInterfacesItem.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NetworkProfileUpdateNetworkInterfacesItem model. */ +@Fluent +public final class NetworkProfileUpdateNetworkInterfacesItem { + /* + * ID - Resource Id + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: ID - Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID - Resource Id. + * + * @param id the id value to set. + * @return the NetworkProfileUpdateNetworkInterfacesItem object itself. + */ + public NetworkProfileUpdateNetworkInterfacesItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Networkinterfaces.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Networkinterfaces.java new file mode 100644 index 0000000000000..610c7d3af10b4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Networkinterfaces.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkinterfacesInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Networkinterfaces. */ +public interface Networkinterfaces { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + NetworkinterfacesExtendedLocation extendedLocation(); + + /** + * Gets the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the macAddress property: MacAddress - The MAC address of the network interface. + * + * @return the macAddress value. + */ + String macAddress(); + + /** + * Gets the dnsSettings property: DNS Settings for the interface. + * + * @return the dnsSettings value. + */ + InterfaceDnsSettings dnsSettings(); + + /** + * Gets the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the status property: MOCNetworkInterfaceStatus defines the observed state of MOCNetworkInterface. + * + * @return the status value. + */ + Object status(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.NetworkinterfacesInner object. + * + * @return the inner object. + */ + NetworkinterfacesInner innerModel(); + + /** The entirety of the Networkinterfaces definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Networkinterfaces definition stages. */ + interface DefinitionStages { + /** The first stage of the Networkinterfaces definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Networkinterfaces definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Networkinterfaces definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Networkinterfaces 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.WithExtendedLocation, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithMacAddress, + DefinitionStages.WithDnsSettings, + DefinitionStages.WithProvisioningState, + DefinitionStages.WithResourceName, + DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + Networkinterfaces create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Networkinterfaces create(Context context); + } + /** The stage of the Networkinterfaces definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Networkinterfaces definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation property.. + * + * @param extendedLocation The extendedLocation property. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(NetworkinterfacesExtendedLocation extendedLocation); + } + /** The stage of the Networkinterfaces definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IPConfigurations - A list of IPConfigurations of the network + * interface.. + * + * @param ipConfigurations IPConfigurations - A list of IPConfigurations of the network interface. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the Networkinterfaces definition allowing to specify macAddress. */ + interface WithMacAddress { + /** + * Specifies the macAddress property: MacAddress - The MAC address of the network interface.. + * + * @param macAddress MacAddress - The MAC address of the network interface. + * @return the next definition stage. + */ + WithCreate withMacAddress(String macAddress); + } + /** The stage of the Networkinterfaces definition allowing to specify dnsSettings. */ + interface WithDnsSettings { + /** + * Specifies the dnsSettings property: DNS Settings for the interface. + * + * @param dnsSettings DNS Settings for the interface. + * @return the next definition stage. + */ + WithCreate withDnsSettings(InterfaceDnsSettings dnsSettings); + } + /** The stage of the Networkinterfaces definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioningState property.. + * + * @param provisioningState The provisioningState property. + * @return the next definition stage. + */ + WithCreate withProvisioningState(String provisioningState); + } + /** The stage of the Networkinterfaces definition allowing to specify resourceName. */ + interface WithResourceName { + /** + * Specifies the resourceName property: name of the object to be used in moc. + * + * @param resourceName name of the object to be used in moc. + * @return the next definition stage. + */ + WithCreate withResourceName(String resourceName); + } + /** The stage of the Networkinterfaces definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: MOCNetworkInterfaceStatus defines the observed state of + * MOCNetworkInterface. + * + * @param status MOCNetworkInterfaceStatus defines the observed state of MOCNetworkInterface. + * @return the next definition stage. + */ + WithCreate withStatus(Object status); + } + } + /** + * Begins update for the Networkinterfaces resource. + * + * @return the stage of resource update. + */ + Networkinterfaces.Update update(); + + /** The template for Networkinterfaces update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Networkinterfaces apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Networkinterfaces apply(Context context); + } + /** The Networkinterfaces update stages. */ + interface UpdateStages { + /** The stage of the Networkinterfaces update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Networkinterfaces refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Networkinterfaces refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesExtendedLocation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesExtendedLocation.java new file mode 100644 index 0000000000000..92bdd149bad3d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesExtendedLocation.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NetworkinterfacesExtendedLocation model. */ +@Fluent +public final class NetworkinterfacesExtendedLocation { + /* + * The extended location type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The extended location name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The extended location type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The extended location type. + * + * @param type the type value to set. + * @return the NetworkinterfacesExtendedLocation object itself. + */ + public NetworkinterfacesExtendedLocation withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: The extended location name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The extended location name. + * + * @param name the name value to set. + * @return the NetworkinterfacesExtendedLocation object itself. + */ + public NetworkinterfacesExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesListResult.java new file mode 100644 index 0000000000000..e02f1ec16d58c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.NetworkinterfacesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NetworkinterfacesListResult model. */ +@Fluent +public final class NetworkinterfacesListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the NetworkinterfacesListResult object itself. + */ + public NetworkinterfacesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the NetworkinterfacesListResult object itself. + */ + public NetworkinterfacesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesOperations.java new file mode 100644 index 0000000000000..00de15d529056 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesOperations.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 NetworkinterfacesOperations. */ +public interface NetworkinterfacesOperations { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition. + */ + Networkinterfaces getByResourceGroup(String resourceGroupName, String networkinterfacesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @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 networkinterfaces resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkinterfacesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String networkinterfacesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkinterfacesName The networkinterfacesName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String networkinterfacesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition along with {@link Response}. + */ + Networkinterfaces getById(String id); + + /** + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the networkinterfaces resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Networkinterfaces resource. + * + * @param name resource name. + * @return the first stage of the new Networkinterfaces definition. + */ + Networkinterfaces.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesPatch.java new file mode 100644 index 0000000000000..6e5591a4b5393 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NetworkinterfacesPatch.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The networkinterfaces resource patch definition. */ +@Fluent +public final class NetworkinterfacesPatch { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the NetworkinterfacesPatch object itself. + */ + public NetworkinterfacesPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperatingSystemTypes.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperatingSystemTypes.java new file mode 100644 index 0000000000000..19b288d86fa0b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperatingSystemTypes.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.azurestackhci.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for OperatingSystemTypes. */ +public enum OperatingSystemTypes { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OperatingSystemTypes instance. */ + private final String value; + + OperatingSystemTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperatingSystemTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed OperatingSystemTypes object, or null if unable to parse. + */ + @JsonCreator + public static OperatingSystemTypes fromString(String value) { + OperatingSystemTypes[] items = OperatingSystemTypes.values(); + for (OperatingSystemTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java new file mode 100644 index 0000000000000..8a8c66e2aafe5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +@Fluent +public final class Operation { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). + * Examples: "Microsoft.Compute/virtualMachines/write", + * "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for + * data-plane operations and "false" for ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access + * Control (RBAC) and audit logs UX. Default value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the Operation object itself. + */ + public Operation withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDetail.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDetail.java deleted file mode 100644 index 78efe34382152..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDetail.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.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; - -/** Operation detail payload. */ -@Fluent -public final class OperationDetail { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetail.class); - - /* - * Name of the operation - */ - @JsonProperty(value = "name") - private String name; - - /* - * Indicates whether the operation is a data action - */ - @JsonProperty(value = "isDataAction") - private Boolean isDataAction; - - /* - * Display of the operation - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * Origin of the operation - */ - @JsonProperty(value = "origin") - private String origin; - - /* - * Properties of the operation - */ - @JsonProperty(value = "properties") - private Object properties; - - /** - * Get the name property: Name of the operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the operation. - * - * @param name the name value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withName(String name) { - this.name = name; - return this; - } - - /** - * Get the isDataAction property: Indicates whether the operation is a data action. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Set the isDataAction property: Indicates whether the operation is a data action. - * - * @param isDataAction the isDataAction value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; - } - - /** - * Get the display property: Display of the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Display of the operation. - * - * @param display the display value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: Origin of the operation. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: Origin of the operation. - * - * @param origin the origin value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the properties property: Properties of the operation. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the operation. - * - * @param properties the properties value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java index b8580f63bfbbd..75a95b413ce47 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java @@ -4,42 +4,44 @@ package com.azure.resourcemanager.azurestackhci.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Operation display payload. */ -@Fluent +/** Localized display information for this particular operation. */ +@Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* - * Resource provider of the operation + * The localized friendly form of the resource provider name, e.g. + * "Microsoft Monitoring Insights" or "Microsoft Compute". */ - @JsonProperty(value = "provider") + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * Resource of the operation + * The localized friendly name of the resource type related to this + * operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ - @JsonProperty(value = "resource") + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * Localized friendly name for the operation + * The concise, localized friendly name for the operation; suitable for + * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual + * Machine". */ - @JsonProperty(value = "operation") + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* - * Localized friendly description for the operation + * The short, localized friendly description of the operation; suitable for + * tool tips and detailed views. */ - @JsonProperty(value = "description") + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /** - * Get the provider property: Resource provider of the operation. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -48,18 +50,8 @@ public String provider() { } /** - * Set the provider property: Resource provider of the operation. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource of the operation. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -68,18 +60,8 @@ public String resource() { } /** - * Set the resource property: Resource of the operation. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Localized friendly name for the operation. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -88,18 +70,8 @@ public String operation() { } /** - * Set the operation property: Localized friendly name for the operation. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Localized friendly description for the operation. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ @@ -107,17 +79,6 @@ public String description() { return this.description; } - /** - * Set the description property: Localized friendly description for the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java new file mode 100644 index 0000000000000..6f6f0475efc84 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; +import java.util.List; + +/** An immutable client-side representation of OperationListResult. */ +public interface OperationListResult { + /** + * Gets the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner object. + * + * @return the inner object. + */ + OperationListResultInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java index 9f0e894f6cdf9..570a7f0abbd4b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java @@ -14,9 +14,9 @@ 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 available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - AvailableOperations list(); + OperationListResult list(); /** * List all available Microsoft.AzureStackHCI provider operations. @@ -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 available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ - Response listWithResponse(Context context); + Response listWithResponse(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java new file mode 100644 index 0000000000000..9762cce2c3792 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Origin. */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** @return known Origin values. */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java deleted file mode 100644 index f0a551b5c4fd5..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProvisioningState. */ -public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningState. */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for ProvisioningState. */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** Static value Canceled for ProvisioningState. */ - public static final ProvisioningState CANCELED = fromString("Canceled"); - - /** Static value Accepted for ProvisioningState. */ - public static final ProvisioningState ACCEPTED = fromString("Accepted"); - - /** Static value Provisioning for ProvisioningState. */ - public static final ProvisioningState PROVISIONING = fromString("Provisioning"); - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - @JsonCreator - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** @return known ProvisioningState values. */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java deleted file mode 100644 index 67354499433da..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Status. */ -public final class Status extends ExpandableStringEnum { - /** Static value NotYetRegistered for Status. */ - public static final Status NOT_YET_REGISTERED = fromString("NotYetRegistered"); - - /** Static value ConnectedRecently for Status. */ - public static final Status CONNECTED_RECENTLY = fromString("ConnectedRecently"); - - /** Static value NotConnectedRecently for Status. */ - public static final Status NOT_CONNECTED_RECENTLY = fromString("NotConnectedRecently"); - - /** Static value Disconnected for Status. */ - public static final Status DISCONNECTED = fromString("Disconnected"); - - /** Static value Error for Status. */ - public static final Status ERROR = fromString("Error"); - - /** - * Creates or finds a Status from its string representation. - * - * @param name a name to look for. - * @return the corresponding Status. - */ - @JsonCreator - public static Status fromString(String name) { - return fromString(name, Status.class); - } - - /** @return known Status values. */ - public static Collection values() { - return values(Status.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdate.java new file mode 100644 index 0000000000000..ce8acb83b4522 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdate.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The StorageProfileUpdate model. */ +@Fluent +public final class StorageProfileUpdate { + /* + * adds data disks to the virtual machine for the update call + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /** + * Get the dataDisks property: adds data disks to the virtual machine for the update call. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: adds data disks to the virtual machine for the update call. + * + * @param dataDisks the dataDisks value to set. + * @return the StorageProfileUpdate object itself. + */ + public StorageProfileUpdate withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdateDataDisksItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdateDataDisksItem.java new file mode 100644 index 0000000000000..0a97d4a2196eb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StorageProfileUpdateDataDisksItem.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageProfileUpdateDataDisksItem model. */ +@Fluent +public final class StorageProfileUpdateDataDisksItem { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the StorageProfileUpdateDataDisksItem object itself. + */ + public StorageProfileUpdateDataDisksItem withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Storagecontainers.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Storagecontainers.java new file mode 100644 index 0000000000000..81c89f60df2fd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Storagecontainers.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.StoragecontainersInner; +import java.util.Map; + +/** An immutable client-side representation of Storagecontainers. */ +public interface Storagecontainers { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + StoragecontainersExtendedLocation extendedLocation(); + + /** + * Gets the path property: location of the image the gallery image should be created from. + * + * @return the path value. + */ + String path(); + + /** + * Gets the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the status property: MOCStorageContainerStatus defines the observed state of MOCStorageContainer. + * + * @return the status value. + */ + Object status(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.StoragecontainersInner object. + * + * @return the inner object. + */ + StoragecontainersInner innerModel(); + + /** The entirety of the Storagecontainers definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Storagecontainers definition stages. */ + interface DefinitionStages { + /** The first stage of the Storagecontainers definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Storagecontainers definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Storagecontainers definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Storagecontainers 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.WithExtendedLocation, + DefinitionStages.WithPath, + DefinitionStages.WithProvisioningState, + DefinitionStages.WithResourceName, + DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + Storagecontainers create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Storagecontainers create(Context context); + } + /** The stage of the Storagecontainers definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Storagecontainers definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation property.. + * + * @param extendedLocation The extendedLocation property. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(StoragecontainersExtendedLocation extendedLocation); + } + /** The stage of the Storagecontainers definition allowing to specify path. */ + interface WithPath { + /** + * Specifies the path property: location of the image the gallery image should be created from. + * + * @param path location of the image the gallery image should be created from. + * @return the next definition stage. + */ + WithCreate withPath(String path); + } + /** The stage of the Storagecontainers definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioningState property.. + * + * @param provisioningState The provisioningState property. + * @return the next definition stage. + */ + WithCreate withProvisioningState(String provisioningState); + } + /** The stage of the Storagecontainers definition allowing to specify resourceName. */ + interface WithResourceName { + /** + * Specifies the resourceName property: name of the object to be used in moc. + * + * @param resourceName name of the object to be used in moc. + * @return the next definition stage. + */ + WithCreate withResourceName(String resourceName); + } + /** The stage of the Storagecontainers definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: MOCStorageContainerStatus defines the observed state of + * MOCStorageContainer. + * + * @param status MOCStorageContainerStatus defines the observed state of MOCStorageContainer. + * @return the next definition stage. + */ + WithCreate withStatus(Object status); + } + } + /** + * Begins update for the Storagecontainers resource. + * + * @return the stage of resource update. + */ + Storagecontainers.Update update(); + + /** The template for Storagecontainers update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Storagecontainers apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Storagecontainers apply(Context context); + } + /** The Storagecontainers update stages. */ + interface UpdateStages { + /** The stage of the Storagecontainers update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Storagecontainers refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Storagecontainers refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersExtendedLocation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersExtendedLocation.java new file mode 100644 index 0000000000000..175f70cb331b5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersExtendedLocation.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StoragecontainersExtendedLocation model. */ +@Fluent +public final class StoragecontainersExtendedLocation { + /* + * The extended location type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The extended location name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The extended location type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The extended location type. + * + * @param type the type value to set. + * @return the StoragecontainersExtendedLocation object itself. + */ + public StoragecontainersExtendedLocation withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: The extended location name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The extended location name. + * + * @param name the name value to set. + * @return the StoragecontainersExtendedLocation object itself. + */ + public StoragecontainersExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersListResult.java new file mode 100644 index 0000000000000..698119bec5bf9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.StoragecontainersInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The StoragecontainersListResult model. */ +@Fluent +public final class StoragecontainersListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the StoragecontainersListResult object itself. + */ + public StoragecontainersListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the StoragecontainersListResult object itself. + */ + public StoragecontainersListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersOperations.java new file mode 100644 index 0000000000000..86ae6cb688255 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersOperations.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 StoragecontainersOperations. */ +public interface StoragecontainersOperations { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition. + */ + Storagecontainers getByResourceGroup(String resourceGroupName, String storagecontainersName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @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 storagecontainers resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String storagecontainersName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String storagecontainersName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storagecontainersName The storagecontainersName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String storagecontainersName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition along with {@link Response}. + */ + Storagecontainers getById(String id); + + /** + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storagecontainers resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Storagecontainers resource. + * + * @param name resource name. + * @return the first stage of the new Storagecontainers definition. + */ + Storagecontainers.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersPatch.java new file mode 100644 index 0000000000000..5bbb4cdfc5025 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StoragecontainersPatch.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The storagecontainers resource patch definition. */ +@Fluent +public final class StoragecontainersPatch { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the StoragecontainersPatch object itself. + */ + public StoragecontainersPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineUpdateProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineUpdateProperties.java new file mode 100644 index 0000000000000..57545bb6081d8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualMachineUpdateProperties.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the resource properties for the update. */ +@Fluent +public final class VirtualMachineUpdateProperties { + /* + * HardwareProfile - Specifies the hardware settings for the virtual + * machine. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfileUpdate hardwareProfile; + + /* + * The storageProfile property. + */ + @JsonProperty(value = "storageProfile") + private StorageProfileUpdate storageProfile; + + /* + * NetworkProfile - describes the network update configuration the virtual + * machine + */ + @JsonProperty(value = "networkProfile") + private NetworkProfileUpdate networkProfile; + + /** + * Get the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public HardwareProfileUpdate hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineUpdateProperties object itself. + */ + public VirtualMachineUpdateProperties withHardwareProfile(HardwareProfileUpdate hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the storageProfile property: The storageProfile property. + * + * @return the storageProfile value. + */ + public StorageProfileUpdate storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: The storageProfile property. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineUpdateProperties object itself. + */ + public VirtualMachineUpdateProperties withStorageProfile(StorageProfileUpdate storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the networkProfile property: NetworkProfile - describes the network update configuration the virtual machine. + * + * @return the networkProfile value. + */ + public NetworkProfileUpdate networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: NetworkProfile - describes the network update configuration the virtual machine. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineUpdateProperties object itself. + */ + public VirtualMachineUpdateProperties withNetworkProfile(NetworkProfileUpdate networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Virtualharddisks.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Virtualharddisks.java new file mode 100644 index 0000000000000..928449352ace0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Virtualharddisks.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualharddisksInner; +import java.util.Map; + +/** An immutable client-side representation of Virtualharddisks. */ +public interface Virtualharddisks { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + VirtualharddisksExtendedLocation extendedLocation(); + + /** + * Gets the blockSizeBytes property: The blockSizeBytes property. + * + * @return the blockSizeBytes value. + */ + Integer blockSizeBytes(); + + /** + * Gets the diskSizeBytes property: diskSizeBytes - size of the disk in GB. + * + * @return the diskSizeBytes value. + */ + Long diskSizeBytes(); + + /** + * Gets the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @return the dynamic value. + */ + Boolean dynamic(); + + /** + * Gets the logicalSectorBytes property: The logicalSectorBytes property. + * + * @return the logicalSectorBytes value. + */ + Integer logicalSectorBytes(); + + /** + * Gets the physicalSectorBytes property: The physicalSectorBytes property. + * + * @return the physicalSectorBytes value. + */ + Integer physicalSectorBytes(); + + /** + * Gets the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the status property: MOCVirtualHardDiskStatus defines the observed state of MOCVirtualHardDisk. + * + * @return the status value. + */ + Object status(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.VirtualharddisksInner object. + * + * @return the inner object. + */ + VirtualharddisksInner innerModel(); + + /** The entirety of the Virtualharddisks definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Virtualharddisks definition stages. */ + interface DefinitionStages { + /** The first stage of the Virtualharddisks definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Virtualharddisks definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Virtualharddisks definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Virtualharddisks 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.WithExtendedLocation, + DefinitionStages.WithBlockSizeBytes, + DefinitionStages.WithDiskSizeBytes, + DefinitionStages.WithDynamic, + DefinitionStages.WithLogicalSectorBytes, + DefinitionStages.WithPhysicalSectorBytes, + DefinitionStages.WithProvisioningState, + DefinitionStages.WithResourceName, + DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + Virtualharddisks create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Virtualharddisks create(Context context); + } + /** The stage of the Virtualharddisks definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Virtualharddisks definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation property.. + * + * @param extendedLocation The extendedLocation property. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(VirtualharddisksExtendedLocation extendedLocation); + } + /** The stage of the Virtualharddisks definition allowing to specify blockSizeBytes. */ + interface WithBlockSizeBytes { + /** + * Specifies the blockSizeBytes property: The blockSizeBytes property.. + * + * @param blockSizeBytes The blockSizeBytes property. + * @return the next definition stage. + */ + WithCreate withBlockSizeBytes(Integer blockSizeBytes); + } + /** The stage of the Virtualharddisks definition allowing to specify diskSizeBytes. */ + interface WithDiskSizeBytes { + /** + * Specifies the diskSizeBytes property: diskSizeBytes - size of the disk in GB. + * + * @param diskSizeBytes diskSizeBytes - size of the disk in GB. + * @return the next definition stage. + */ + WithCreate withDiskSizeBytes(Long diskSizeBytes); + } + /** The stage of the Virtualharddisks definition allowing to specify dynamic. */ + interface WithDynamic { + /** + * Specifies the dynamic property: Boolean for enabling dynamic sizing on the virtual hard disk. + * + * @param dynamic Boolean for enabling dynamic sizing on the virtual hard disk. + * @return the next definition stage. + */ + WithCreate withDynamic(Boolean dynamic); + } + /** The stage of the Virtualharddisks definition allowing to specify logicalSectorBytes. */ + interface WithLogicalSectorBytes { + /** + * Specifies the logicalSectorBytes property: The logicalSectorBytes property.. + * + * @param logicalSectorBytes The logicalSectorBytes property. + * @return the next definition stage. + */ + WithCreate withLogicalSectorBytes(Integer logicalSectorBytes); + } + /** The stage of the Virtualharddisks definition allowing to specify physicalSectorBytes. */ + interface WithPhysicalSectorBytes { + /** + * Specifies the physicalSectorBytes property: The physicalSectorBytes property.. + * + * @param physicalSectorBytes The physicalSectorBytes property. + * @return the next definition stage. + */ + WithCreate withPhysicalSectorBytes(Integer physicalSectorBytes); + } + /** The stage of the Virtualharddisks definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioningState property.. + * + * @param provisioningState The provisioningState property. + * @return the next definition stage. + */ + WithCreate withProvisioningState(String provisioningState); + } + /** The stage of the Virtualharddisks definition allowing to specify resourceName. */ + interface WithResourceName { + /** + * Specifies the resourceName property: name of the object to be used in moc. + * + * @param resourceName name of the object to be used in moc. + * @return the next definition stage. + */ + WithCreate withResourceName(String resourceName); + } + /** The stage of the Virtualharddisks definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: MOCVirtualHardDiskStatus defines the observed state of MOCVirtualHardDisk. + * + * @param status MOCVirtualHardDiskStatus defines the observed state of MOCVirtualHardDisk. + * @return the next definition stage. + */ + WithCreate withStatus(Object status); + } + } + /** + * Begins update for the Virtualharddisks resource. + * + * @return the stage of resource update. + */ + Virtualharddisks.Update update(); + + /** The template for Virtualharddisks update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Virtualharddisks apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Virtualharddisks apply(Context context); + } + /** The Virtualharddisks update stages. */ + interface UpdateStages { + /** The stage of the Virtualharddisks update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Virtualharddisks refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Virtualharddisks refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksExtendedLocation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksExtendedLocation.java new file mode 100644 index 0000000000000..a5ce57b113b86 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksExtendedLocation.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualharddisksExtendedLocation model. */ +@Fluent +public final class VirtualharddisksExtendedLocation { + /* + * The extended location type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The extended location name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The extended location type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The extended location type. + * + * @param type the type value to set. + * @return the VirtualharddisksExtendedLocation object itself. + */ + public VirtualharddisksExtendedLocation withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: The extended location name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The extended location name. + * + * @param name the name value to set. + * @return the VirtualharddisksExtendedLocation object itself. + */ + public VirtualharddisksExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksListResult.java new file mode 100644 index 0000000000000..ca3007d213174 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualharddisksInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The VirtualharddisksListResult model. */ +@Fluent +public final class VirtualharddisksListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the VirtualharddisksListResult object itself. + */ + public VirtualharddisksListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the VirtualharddisksListResult object itself. + */ + public VirtualharddisksListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksOperations.java new file mode 100644 index 0000000000000..15bfd2cd1b63c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksOperations.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 VirtualharddisksOperations. */ +public interface VirtualharddisksOperations { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition. + */ + Virtualharddisks getByResourceGroup(String resourceGroupName, String virtualharddisksName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @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 virtualharddisks resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualharddisksName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String virtualharddisksName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualharddisksName The virtualharddisksName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String virtualharddisksName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition along with {@link Response}. + */ + Virtualharddisks getById(String id); + + /** + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualharddisks resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Virtualharddisks resource. + * + * @param name resource name. + * @return the first stage of the new Virtualharddisks definition. + */ + Virtualharddisks.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksPatch.java new file mode 100644 index 0000000000000..d4bdde4883742 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualharddisksPatch.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The virtualharddisks resource patch definition. */ +@Fluent +public final class VirtualharddisksPatch { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VirtualharddisksPatch object itself. + */ + public VirtualharddisksPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Virtualmachines.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Virtualmachines.java new file mode 100644 index 0000000000000..d9fa4fd07788c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Virtualmachines.java @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualmachinesInner; +import java.util.Map; + +/** An immutable client-side representation of Virtualmachines. */ +public interface Virtualmachines { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + VirtualmachinesExtendedLocation extendedLocation(); + + /** + * Gets the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + VirtualmachinesPropertiesHardwareProfile hardwareProfile(); + + /** + * Gets the networkProfile property: NetworkProfile - describes the network configuration the virtual machine. + * + * @return the networkProfile value. + */ + VirtualmachinesPropertiesNetworkProfile networkProfile(); + + /** + * Gets the osProfile property: OsProfile - describes the configuration of the operating system and sets login data. + * + * @return the osProfile value. + */ + VirtualmachinesPropertiesOsProfile osProfile(); + + /** + * Gets the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the securityProfile property: SecurityProfile - Specifies the security settings for the virtual machine. + * + * @return the securityProfile value. + */ + VirtualmachinesPropertiesSecurityProfile securityProfile(); + + /** + * Gets the storageProfile property: StorageProfile - contains information about the disks and storage information + * for the virtual machine. + * + * @return the storageProfile value. + */ + VirtualmachinesPropertiesStorageProfile storageProfile(); + + /** + * Gets the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the status property: MOCVirtualMachineStatus defines the observed state of MOCVirtualMachine. + * + * @return the status value. + */ + Object status(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.VirtualmachinesInner object. + * + * @return the inner object. + */ + VirtualmachinesInner innerModel(); + + /** The entirety of the Virtualmachines definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Virtualmachines definition stages. */ + interface DefinitionStages { + /** The first stage of the Virtualmachines definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Virtualmachines definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Virtualmachines definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Virtualmachines 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.WithExtendedLocation, + DefinitionStages.WithHardwareProfile, + DefinitionStages.WithNetworkProfile, + DefinitionStages.WithOsProfile, + DefinitionStages.WithResourceName, + DefinitionStages.WithSecurityProfile, + DefinitionStages.WithStorageProfile, + DefinitionStages.WithProvisioningState, + DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + Virtualmachines create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Virtualmachines create(Context context); + } + /** The stage of the Virtualmachines definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Virtualmachines definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation property.. + * + * @param extendedLocation The extendedLocation property. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(VirtualmachinesExtendedLocation extendedLocation); + } + /** The stage of the Virtualmachines definition allowing to specify hardwareProfile. */ + interface WithHardwareProfile { + /** + * Specifies the hardwareProfile property: HardwareProfile - Specifies the hardware settings for the virtual + * machine.. + * + * @param hardwareProfile HardwareProfile - Specifies the hardware settings for the virtual machine. + * @return the next definition stage. + */ + WithCreate withHardwareProfile(VirtualmachinesPropertiesHardwareProfile hardwareProfile); + } + /** The stage of the Virtualmachines definition allowing to specify networkProfile. */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: NetworkProfile - describes the network configuration the virtual + * machine. + * + * @param networkProfile NetworkProfile - describes the network configuration the virtual machine. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(VirtualmachinesPropertiesNetworkProfile networkProfile); + } + /** The stage of the Virtualmachines definition allowing to specify osProfile. */ + interface WithOsProfile { + /** + * Specifies the osProfile property: OsProfile - describes the configuration of the operating system and + * sets login data. + * + * @param osProfile OsProfile - describes the configuration of the operating system and sets login data. + * @return the next definition stage. + */ + WithCreate withOsProfile(VirtualmachinesPropertiesOsProfile osProfile); + } + /** The stage of the Virtualmachines definition allowing to specify resourceName. */ + interface WithResourceName { + /** + * Specifies the resourceName property: name of the object to be used in moc. + * + * @param resourceName name of the object to be used in moc. + * @return the next definition stage. + */ + WithCreate withResourceName(String resourceName); + } + /** The stage of the Virtualmachines definition allowing to specify securityProfile. */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: SecurityProfile - Specifies the security settings for the virtual + * machine.. + * + * @param securityProfile SecurityProfile - Specifies the security settings for the virtual machine. + * @return the next definition stage. + */ + WithCreate withSecurityProfile(VirtualmachinesPropertiesSecurityProfile securityProfile); + } + /** The stage of the Virtualmachines definition allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: StorageProfile - contains information about the disks and storage + * information for the virtual machine. + * + * @param storageProfile StorageProfile - contains information about the disks and storage information for + * the virtual machine. + * @return the next definition stage. + */ + WithCreate withStorageProfile(VirtualmachinesPropertiesStorageProfile storageProfile); + } + /** The stage of the Virtualmachines definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioningState property.. + * + * @param provisioningState The provisioningState property. + * @return the next definition stage. + */ + WithCreate withProvisioningState(String provisioningState); + } + /** The stage of the Virtualmachines definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: MOCVirtualMachineStatus defines the observed state of MOCVirtualMachine. + * + * @param status MOCVirtualMachineStatus defines the observed state of MOCVirtualMachine. + * @return the next definition stage. + */ + WithCreate withStatus(Object status); + } + } + /** + * Begins update for the Virtualmachines resource. + * + * @return the stage of resource update. + */ + Virtualmachines.Update update(); + + /** The template for Virtualmachines update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Virtualmachines apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Virtualmachines apply(Context context); + } + /** The Virtualmachines update stages. */ + interface UpdateStages { + /** The stage of the Virtualmachines update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Virtualmachines update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Defines the resource properties for the update.. + * + * @param properties Defines the resource properties for the update. + * @return the next definition stage. + */ + Update withProperties(VirtualMachineUpdateProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Virtualmachines refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Virtualmachines refresh(Context context); + + /** + * @throws com.azure.core.management.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 start(); + + /** + * @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 start(Context context); + + /** + * @throws com.azure.core.management.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 stop(); + + /** + * @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 stop(Context context); + + /** + * @throws com.azure.core.management.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 restart(); + + /** + * @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 restart(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesExtendedLocation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesExtendedLocation.java new file mode 100644 index 0000000000000..0154bf4d8586c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesExtendedLocation.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualmachinesExtendedLocation model. */ +@Fluent +public final class VirtualmachinesExtendedLocation { + /* + * The extended location type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The extended location name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The extended location type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The extended location type. + * + * @param type the type value to set. + * @return the VirtualmachinesExtendedLocation object itself. + */ + public VirtualmachinesExtendedLocation withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: The extended location name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The extended location name. + * + * @param name the name value to set. + * @return the VirtualmachinesExtendedLocation object itself. + */ + public VirtualmachinesExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesListResult.java new file mode 100644 index 0000000000000..be7a6adb66139 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualmachinesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The VirtualmachinesListResult model. */ +@Fluent +public final class VirtualmachinesListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the VirtualmachinesListResult object itself. + */ + public VirtualmachinesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the VirtualmachinesListResult object itself. + */ + public VirtualmachinesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesOperations.java new file mode 100644 index 0000000000000..082b114d9e59b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesOperations.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 VirtualmachinesOperations. */ +public interface VirtualmachinesOperations { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition. + */ + Virtualmachines getByResourceGroup(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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 virtualmachines resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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 start(String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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 stop(String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String virtualmachinesName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualmachinesName The virtualmachinesName parameter. + * @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 restart(String resourceGroupName, String virtualmachinesName, Context context); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition along with {@link Response}. + */ + Virtualmachines getById(String id); + + /** + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtualmachines resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Virtualmachines resource. + * + * @param name resource name. + * @return the first stage of the new Virtualmachines definition. + */ + Virtualmachines.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPatch.java new file mode 100644 index 0000000000000..3bdb9770238ea --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPatch.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The virtualmachines resource patch definition. */ +@Fluent +public final class VirtualmachinesPatch { + /* + * Defines the resource properties for the update. + */ + @JsonProperty(value = "properties") + private VirtualMachineUpdateProperties properties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the properties property: Defines the resource properties for the update. + * + * @return the properties value. + */ + public VirtualMachineUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Defines the resource properties for the update. + * + * @param properties the properties value to set. + * @return the VirtualmachinesPatch object itself. + */ + public VirtualmachinesPatch withProperties(VirtualMachineUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VirtualmachinesPatch object itself. + */ + public VirtualmachinesPatch withTags(Map tags) { + this.tags = tags; + 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/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesHardwareProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesHardwareProfile.java new file mode 100644 index 0000000000000..f258917bb8fd7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesHardwareProfile.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HardwareProfile - Specifies the hardware settings for the virtual machine. */ +@Fluent +public final class VirtualmachinesPropertiesHardwareProfile { + /* + * The vmSize property. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /* + * number of processors for the virtual machine + */ + @JsonProperty(value = "processors") + private Integer processors; + + /* + * RAM in gb for the virtual machine + */ + @JsonProperty(value = "memoryGB") + private Integer memoryGB; + + /* + * The dynamicMemoryConfig property. + */ + @JsonProperty(value = "dynamicMemoryConfig") + private VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig dynamicMemoryConfig; + + /** + * Get the vmSize property: The vmSize property. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The vmSize property. + * + * @param vmSize the vmSize value to set. + * @return the VirtualmachinesPropertiesHardwareProfile object itself. + */ + public VirtualmachinesPropertiesHardwareProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the processors property: number of processors for the virtual machine. + * + * @return the processors value. + */ + public Integer processors() { + return this.processors; + } + + /** + * Set the processors property: number of processors for the virtual machine. + * + * @param processors the processors value to set. + * @return the VirtualmachinesPropertiesHardwareProfile object itself. + */ + public VirtualmachinesPropertiesHardwareProfile withProcessors(Integer processors) { + this.processors = processors; + return this; + } + + /** + * Get the memoryGB property: RAM in gb for the virtual machine. + * + * @return the memoryGB value. + */ + public Integer memoryGB() { + return this.memoryGB; + } + + /** + * Set the memoryGB property: RAM in gb for the virtual machine. + * + * @param memoryGB the memoryGB value to set. + * @return the VirtualmachinesPropertiesHardwareProfile object itself. + */ + public VirtualmachinesPropertiesHardwareProfile withMemoryGB(Integer memoryGB) { + this.memoryGB = memoryGB; + return this; + } + + /** + * Get the dynamicMemoryConfig property: The dynamicMemoryConfig property. + * + * @return the dynamicMemoryConfig value. + */ + public VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig dynamicMemoryConfig() { + return this.dynamicMemoryConfig; + } + + /** + * Set the dynamicMemoryConfig property: The dynamicMemoryConfig property. + * + * @param dynamicMemoryConfig the dynamicMemoryConfig value to set. + * @return the VirtualmachinesPropertiesHardwareProfile object itself. + */ + public VirtualmachinesPropertiesHardwareProfile withDynamicMemoryConfig( + VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig dynamicMemoryConfig) { + this.dynamicMemoryConfig = dynamicMemoryConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dynamicMemoryConfig() != null) { + dynamicMemoryConfig().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig.java new file mode 100644 index 0000000000000..e920447ced019 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig model. */ +@Fluent +public final class VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig { + /* + * The maximumMemoryGB property. + */ + @JsonProperty(value = "maximumMemoryGB") + private Long maximumMemoryGB; + + /* + * The minimumMemoryGB property. + */ + @JsonProperty(value = "minimumMemoryGB") + private Long minimumMemoryGB; + + /* + * The targetMemoryBuffer property. + */ + @JsonProperty(value = "targetMemoryBuffer") + private Integer targetMemoryBuffer; + + /** + * Get the maximumMemoryGB property: The maximumMemoryGB property. + * + * @return the maximumMemoryGB value. + */ + public Long maximumMemoryGB() { + return this.maximumMemoryGB; + } + + /** + * Set the maximumMemoryGB property: The maximumMemoryGB property. + * + * @param maximumMemoryGB the maximumMemoryGB value to set. + * @return the VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig object itself. + */ + public VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig withMaximumMemoryGB(Long maximumMemoryGB) { + this.maximumMemoryGB = maximumMemoryGB; + return this; + } + + /** + * Get the minimumMemoryGB property: The minimumMemoryGB property. + * + * @return the minimumMemoryGB value. + */ + public Long minimumMemoryGB() { + return this.minimumMemoryGB; + } + + /** + * Set the minimumMemoryGB property: The minimumMemoryGB property. + * + * @param minimumMemoryGB the minimumMemoryGB value to set. + * @return the VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig object itself. + */ + public VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig withMinimumMemoryGB(Long minimumMemoryGB) { + this.minimumMemoryGB = minimumMemoryGB; + return this; + } + + /** + * Get the targetMemoryBuffer property: The targetMemoryBuffer property. + * + * @return the targetMemoryBuffer value. + */ + public Integer targetMemoryBuffer() { + return this.targetMemoryBuffer; + } + + /** + * Set the targetMemoryBuffer property: The targetMemoryBuffer property. + * + * @param targetMemoryBuffer the targetMemoryBuffer value to set. + * @return the VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig object itself. + */ + public VirtualmachinesPropertiesHardwareProfileDynamicMemoryConfig withTargetMemoryBuffer( + Integer targetMemoryBuffer) { + this.targetMemoryBuffer = targetMemoryBuffer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesNetworkProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesNetworkProfile.java new file mode 100644 index 0000000000000..93edb8a5edd88 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesNetworkProfile.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkProfile - describes the network configuration the virtual machine. */ +@Fluent +public final class VirtualmachinesPropertiesNetworkProfile { + /* + * NetworkInterfaces - list of network interfaces to be attached to the + * virtual machine + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get the networkInterfaces property: NetworkInterfaces - list of network interfaces to be attached to the virtual + * machine. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: NetworkInterfaces - list of network interfaces to be attached to the virtual + * machine. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the VirtualmachinesPropertiesNetworkProfile object itself. + */ + public VirtualmachinesPropertiesNetworkProfile withNetworkInterfaces( + List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem.java new file mode 100644 index 0000000000000..5509bfe7b9a92 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem model. */ +@Fluent +public final class VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem { + /* + * ID - Resource Id + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: ID - Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID - Resource Id. + * + * @param id the id value to set. + * @return the VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem object itself. + */ + public VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfile.java new file mode 100644 index 0000000000000..b962ea65e38c4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfile.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OsProfile - describes the configuration of the operating system and sets login data. */ +@Fluent +public final class VirtualmachinesPropertiesOsProfile { + /* + * AdminPassword - admin password + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * AdminUsername - admin username + */ + @JsonProperty(value = "adminUsername") + private String adminUsername; + + /* + * ComputerName - name of the compute + */ + @JsonProperty(value = "computerName") + private String computerName; + + /* + * LinuxConfiguration - linux specific configuration values for the virtual + * machine + */ + @JsonProperty(value = "linuxConfiguration") + private VirtualmachinesPropertiesOsProfileLinuxConfiguration linuxConfiguration; + + /* + * OsType - string specifying whether the OS is Linux or Windows + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * Windows Configuration for the virtual machine + */ + @JsonProperty(value = "windowsConfiguration") + private VirtualmachinesPropertiesOsProfileWindowsConfiguration windowsConfiguration; + + /** + * Get the adminPassword property: AdminPassword - admin password. + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: AdminPassword - admin password. + * + * @param adminPassword the adminPassword value to set. + * @return the VirtualmachinesPropertiesOsProfile object itself. + */ + public VirtualmachinesPropertiesOsProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the adminUsername property: AdminUsername - admin username. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: AdminUsername - admin username. + * + * @param adminUsername the adminUsername value to set. + * @return the VirtualmachinesPropertiesOsProfile object itself. + */ + public VirtualmachinesPropertiesOsProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the computerName property: ComputerName - name of the compute. + * + * @return the computerName value. + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the computerName property: ComputerName - name of the compute. + * + * @param computerName the computerName value to set. + * @return the VirtualmachinesPropertiesOsProfile object itself. + */ + public VirtualmachinesPropertiesOsProfile withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the linuxConfiguration property: LinuxConfiguration - linux specific configuration values for the virtual + * machine. + * + * @return the linuxConfiguration value. + */ + public VirtualmachinesPropertiesOsProfileLinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: LinuxConfiguration - linux specific configuration values for the virtual + * machine. + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the VirtualmachinesPropertiesOsProfile object itself. + */ + public VirtualmachinesPropertiesOsProfile withLinuxConfiguration( + VirtualmachinesPropertiesOsProfileLinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the osType property: OsType - string specifying whether the OS is Linux or Windows. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: OsType - string specifying whether the OS is Linux or Windows. + * + * @param osType the osType value to set. + * @return the VirtualmachinesPropertiesOsProfile object itself. + */ + public VirtualmachinesPropertiesOsProfile withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the windowsConfiguration property: Windows Configuration for the virtual machine. + * + * @return the windowsConfiguration value. + */ + public VirtualmachinesPropertiesOsProfileWindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: Windows Configuration for the virtual machine. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the VirtualmachinesPropertiesOsProfile object itself. + */ + public VirtualmachinesPropertiesOsProfile withWindowsConfiguration( + VirtualmachinesPropertiesOsProfileWindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileLinuxConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileLinuxConfiguration.java new file mode 100644 index 0000000000000..0693ca5695845 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileLinuxConfiguration.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** LinuxConfiguration - linux specific configuration values for the virtual machine. */ +@Fluent +public final class VirtualmachinesPropertiesOsProfileLinuxConfiguration { + /* + * DisablePasswordAuthentication - whether password authentication should + * be disabled + */ + @JsonProperty(value = "disablePasswordAuthentication") + private Boolean disablePasswordAuthentication; + + /* + * SSH - contains settings related to ssh configuration + */ + @JsonProperty(value = "ssh") + private VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh ssh; + + /** + * Get the disablePasswordAuthentication property: DisablePasswordAuthentication - whether password authentication + * should be disabled. + * + * @return the disablePasswordAuthentication value. + */ + public Boolean disablePasswordAuthentication() { + return this.disablePasswordAuthentication; + } + + /** + * Set the disablePasswordAuthentication property: DisablePasswordAuthentication - whether password authentication + * should be disabled. + * + * @param disablePasswordAuthentication the disablePasswordAuthentication value to set. + * @return the VirtualmachinesPropertiesOsProfileLinuxConfiguration object itself. + */ + public VirtualmachinesPropertiesOsProfileLinuxConfiguration withDisablePasswordAuthentication( + Boolean disablePasswordAuthentication) { + this.disablePasswordAuthentication = disablePasswordAuthentication; + return this; + } + + /** + * Get the ssh property: SSH - contains settings related to ssh configuration. + * + * @return the ssh value. + */ + public VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh ssh() { + return this.ssh; + } + + /** + * Set the ssh property: SSH - contains settings related to ssh configuration. + * + * @param ssh the ssh value to set. + * @return the VirtualmachinesPropertiesOsProfileLinuxConfiguration object itself. + */ + public VirtualmachinesPropertiesOsProfileLinuxConfiguration withSsh( + VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh ssh) { + this.ssh = ssh; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ssh() != null) { + ssh().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh.java new file mode 100644 index 0000000000000..15b98a85e7ee6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSH - contains settings related to ssh configuration. */ +@Fluent +public final class VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh { + /* + * PublicKeys - The list of SSH public keys used to authenticate with linux + * based VMs. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the publicKeys property: PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. + * + * @param publicKeys the publicKeys value to set. + * @return the VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh object itself. + */ + public VirtualmachinesPropertiesOsProfileLinuxConfigurationSsh withPublicKeys( + List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() != null) { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem.java new file mode 100644 index 0000000000000..9f3087822b7f2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem model. */ +@Fluent +public final class VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem { + /* + * KeyData - SSH public key certificate used to authenticate with the VM + * through ssh. The key needs to be at least 2048-bit and in ssh-rsa + * format.

For creating ssh keys, see [Create SSH keys on Linux + * and Mac for Li nux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ + @JsonProperty(value = "keyData") + private String keyData; + + /* + * Path - Specifies the full path on the created VM where ssh public key is + * stored. If the file already exists, the specified key is appended to the + * file. Example: /home/user/.ssh/authorized_keys + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get the keyData property: KeyData - SSH public key certificate used to authenticate with the VM through ssh. The + * key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create + * SSH keys on Linux and Mac for Li nux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: KeyData - SSH public key certificate used to authenticate with the VM through ssh. The + * key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create + * SSH keys on Linux and Mac for Li nux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param keyData the keyData value to set. + * @return the VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem object itself. + */ + public VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Get the path property: Path - Specifies the full path on the created VM where ssh public key is stored. If the + * file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path - Specifies the full path on the created VM where ssh public key is stored. If the + * file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @param path the path value to set. + * @return the VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem object itself. + */ + public VirtualmachinesPropertiesOsProfileLinuxConfigurationSshPublicKeysItem withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileWindowsConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileWindowsConfiguration.java new file mode 100644 index 0000000000000..3e842fadb24b9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileWindowsConfiguration.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Windows Configuration for the virtual machine. */ +@Fluent +public final class VirtualmachinesPropertiesOsProfileWindowsConfiguration { + /* + * Whether to EnableAutomaticUpdates on the machine + */ + @JsonProperty(value = "enableAutomaticUpdates") + private Boolean enableAutomaticUpdates; + + /* + * SSH Configuration + */ + @JsonProperty(value = "ssh") + private VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh ssh; + + /* + * TimeZone for the virtual machine + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /** + * Get the enableAutomaticUpdates property: Whether to EnableAutomaticUpdates on the machine. + * + * @return the enableAutomaticUpdates value. + */ + public Boolean enableAutomaticUpdates() { + return this.enableAutomaticUpdates; + } + + /** + * Set the enableAutomaticUpdates property: Whether to EnableAutomaticUpdates on the machine. + * + * @param enableAutomaticUpdates the enableAutomaticUpdates value to set. + * @return the VirtualmachinesPropertiesOsProfileWindowsConfiguration object itself. + */ + public VirtualmachinesPropertiesOsProfileWindowsConfiguration withEnableAutomaticUpdates( + Boolean enableAutomaticUpdates) { + this.enableAutomaticUpdates = enableAutomaticUpdates; + return this; + } + + /** + * Get the ssh property: SSH Configuration. + * + * @return the ssh value. + */ + public VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh ssh() { + return this.ssh; + } + + /** + * Set the ssh property: SSH Configuration. + * + * @param ssh the ssh value to set. + * @return the VirtualmachinesPropertiesOsProfileWindowsConfiguration object itself. + */ + public VirtualmachinesPropertiesOsProfileWindowsConfiguration withSsh( + VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh ssh) { + this.ssh = ssh; + return this; + } + + /** + * Get the timeZone property: TimeZone for the virtual machine. + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: TimeZone for the virtual machine. + * + * @param timeZone the timeZone value to set. + * @return the VirtualmachinesPropertiesOsProfileWindowsConfiguration object itself. + */ + public VirtualmachinesPropertiesOsProfileWindowsConfiguration withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ssh() != null) { + ssh().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh.java new file mode 100644 index 0000000000000..a5f2833e67385 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSH Configuration. */ +@Fluent +public final class VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh { + /* + * PublicKeys - The list of SSH public keys used to authenticate with linux + * based VMs. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the publicKeys property: PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. + * + * @param publicKeys the publicKeys value to set. + * @return the VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh object itself. + */ + public VirtualmachinesPropertiesOsProfileWindowsConfigurationSsh withPublicKeys( + List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() != null) { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem.java new file mode 100644 index 0000000000000..22b1a7b600f09 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem model. */ +@Fluent +public final class VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem { + /* + * KeyData - SSH public key certificate used to authenticate with the VM + * through ssh. The key needs to be at least 2048-bit and in ssh-rsa + * format.

For creating ssh keys, see [Create SSH keys on Linux + * and Mac for Li nux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ + @JsonProperty(value = "keyData") + private String keyData; + + /* + * Path - Specifies the full path on the created VM where ssh public key is + * stored. If the file already exists, the specified key is appended to the + * file. Example: /home/user/.ssh/authorized_keys + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get the keyData property: KeyData - SSH public key certificate used to authenticate with the VM through ssh. The + * key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create + * SSH keys on Linux and Mac for Li nux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: KeyData - SSH public key certificate used to authenticate with the VM through ssh. The + * key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create + * SSH keys on Linux and Mac for Li nux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param keyData the keyData value to set. + * @return the VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem object itself. + */ + public VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Get the path property: Path - Specifies the full path on the created VM where ssh public key is stored. If the + * file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path - Specifies the full path on the created VM where ssh public key is stored. If the + * file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @param path the path value to set. + * @return the VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem object itself. + */ + public VirtualmachinesPropertiesOsProfileWindowsConfigurationSshPublicKeysItem withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesSecurityProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesSecurityProfile.java new file mode 100644 index 0000000000000..e3fe05a45b5be --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesSecurityProfile.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SecurityProfile - Specifies the security settings for the virtual machine. */ +@Fluent +public final class VirtualmachinesPropertiesSecurityProfile { + /* + * The enableTPM property. + */ + @JsonProperty(value = "enableTPM") + private Boolean enableTpm; + + /** + * Get the enableTpm property: The enableTPM property. + * + * @return the enableTpm value. + */ + public Boolean enableTpm() { + return this.enableTpm; + } + + /** + * Set the enableTpm property: The enableTPM property. + * + * @param enableTpm the enableTpm value to set. + * @return the VirtualmachinesPropertiesSecurityProfile object itself. + */ + public VirtualmachinesPropertiesSecurityProfile withEnableTpm(Boolean enableTpm) { + this.enableTpm = enableTpm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesStorageProfile.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesStorageProfile.java new file mode 100644 index 0000000000000..eb22ae643e619 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesStorageProfile.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** StorageProfile - contains information about the disks and storage information for the virtual machine. */ +@Fluent +public final class VirtualmachinesPropertiesStorageProfile { + /* + * adds data disks to the virtual machine + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /* + * Which Image to use for the virtual machine + */ + @JsonProperty(value = "imageReference") + private VirtualmachinesPropertiesStorageProfileImageReference imageReference; + + /** + * Get the dataDisks property: adds data disks to the virtual machine. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: adds data disks to the virtual machine. + * + * @param dataDisks the dataDisks value to set. + * @return the VirtualmachinesPropertiesStorageProfile object itself. + */ + public VirtualmachinesPropertiesStorageProfile withDataDisks( + List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Get the imageReference property: Which Image to use for the virtual machine. + * + * @return the imageReference value. + */ + public VirtualmachinesPropertiesStorageProfileImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: Which Image to use for the virtual machine. + * + * @param imageReference the imageReference value to set. + * @return the VirtualmachinesPropertiesStorageProfile object itself. + */ + public VirtualmachinesPropertiesStorageProfile withImageReference( + VirtualmachinesPropertiesStorageProfileImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + if (imageReference() != null) { + imageReference().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesStorageProfileDataDisksItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesStorageProfileDataDisksItem.java new file mode 100644 index 0000000000000..823fb73b53f1c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesStorageProfileDataDisksItem.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualmachinesPropertiesStorageProfileDataDisksItem model. */ +@Fluent +public final class VirtualmachinesPropertiesStorageProfileDataDisksItem { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the VirtualmachinesPropertiesStorageProfileDataDisksItem object itself. + */ + public VirtualmachinesPropertiesStorageProfileDataDisksItem withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesStorageProfileImageReference.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesStorageProfileImageReference.java new file mode 100644 index 0000000000000..57e193187d1a0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualmachinesPropertiesStorageProfileImageReference.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Which Image to use for the virtual machine. */ +@Fluent +public final class VirtualmachinesPropertiesStorageProfileImageReference { + /* + * Name - Name of the image + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: Name - Name of the image. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name - Name of the image. + * + * @param name the name value to set. + * @return the VirtualmachinesPropertiesStorageProfileImageReference object itself. + */ + public VirtualmachinesPropertiesStorageProfileImageReference withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Virtualnetworks.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Virtualnetworks.java new file mode 100644 index 0000000000000..6b6f27d4b9f01 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Virtualnetworks.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualnetworksInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Virtualnetworks. */ +public interface Virtualnetworks { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the extendedLocation property: The extendedLocation property. + * + * @return the extendedLocation value. + */ + VirtualnetworksExtendedLocation extendedLocation(); + + /** + * Gets the networkType property: Type of the network. + * + * @return the networkType value. + */ + String networkType(); + + /** + * Gets the subnets property: Subnet - list of subnets under the virtual network. + * + * @return the subnets value. + */ + List subnets(); + + /** + * Gets the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the resourceName property: name of the object to be used in moc. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the status property: MOCVirtualNetworkStatus defines the observed state of MOCVirtualNetwork. + * + * @return the status value. + */ + Object status(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.VirtualnetworksInner object. + * + * @return the inner object. + */ + VirtualnetworksInner innerModel(); + + /** The entirety of the Virtualnetworks definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Virtualnetworks definition stages. */ + interface DefinitionStages { + /** The first stage of the Virtualnetworks definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Virtualnetworks definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Virtualnetworks definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Virtualnetworks 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.WithExtendedLocation, + DefinitionStages.WithNetworkType, + DefinitionStages.WithSubnets, + DefinitionStages.WithProvisioningState, + DefinitionStages.WithResourceName, + DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + Virtualnetworks create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Virtualnetworks create(Context context); + } + /** The stage of the Virtualnetworks definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Virtualnetworks definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation property.. + * + * @param extendedLocation The extendedLocation property. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(VirtualnetworksExtendedLocation extendedLocation); + } + /** The stage of the Virtualnetworks definition allowing to specify networkType. */ + interface WithNetworkType { + /** + * Specifies the networkType property: Type of the network. + * + * @param networkType Type of the network. + * @return the next definition stage. + */ + WithCreate withNetworkType(String networkType); + } + /** The stage of the Virtualnetworks definition allowing to specify subnets. */ + interface WithSubnets { + /** + * Specifies the subnets property: Subnet - list of subnets under the virtual network. + * + * @param subnets Subnet - list of subnets under the virtual network. + * @return the next definition stage. + */ + WithCreate withSubnets(List subnets); + } + /** The stage of the Virtualnetworks definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioningState property.. + * + * @param provisioningState The provisioningState property. + * @return the next definition stage. + */ + WithCreate withProvisioningState(String provisioningState); + } + /** The stage of the Virtualnetworks definition allowing to specify resourceName. */ + interface WithResourceName { + /** + * Specifies the resourceName property: name of the object to be used in moc. + * + * @param resourceName name of the object to be used in moc. + * @return the next definition stage. + */ + WithCreate withResourceName(String resourceName); + } + /** The stage of the Virtualnetworks definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: MOCVirtualNetworkStatus defines the observed state of MOCVirtualNetwork. + * + * @param status MOCVirtualNetworkStatus defines the observed state of MOCVirtualNetwork. + * @return the next definition stage. + */ + WithCreate withStatus(Object status); + } + } + /** + * Begins update for the Virtualnetworks resource. + * + * @return the stage of resource update. + */ + Virtualnetworks.Update update(); + + /** The template for Virtualnetworks update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Virtualnetworks apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Virtualnetworks apply(Context context); + } + /** The Virtualnetworks update stages. */ + interface UpdateStages { + /** The stage of the Virtualnetworks update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Virtualnetworks refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Virtualnetworks refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksExtendedLocation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksExtendedLocation.java new file mode 100644 index 0000000000000..f8e08efe840c1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksExtendedLocation.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualnetworksExtendedLocation model. */ +@Fluent +public final class VirtualnetworksExtendedLocation { + /* + * The extended location type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The extended location name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The extended location type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The extended location type. + * + * @param type the type value to set. + * @return the VirtualnetworksExtendedLocation object itself. + */ + public VirtualnetworksExtendedLocation withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: The extended location name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The extended location name. + * + * @param name the name value to set. + * @return the VirtualnetworksExtendedLocation object itself. + */ + public VirtualnetworksExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksListResult.java new file mode 100644 index 0000000000000..9706b05286d7f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualnetworksInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The VirtualnetworksListResult model. */ +@Fluent +public final class VirtualnetworksListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the VirtualnetworksListResult object itself. + */ + public VirtualnetworksListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the VirtualnetworksListResult object itself. + */ + public VirtualnetworksListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksOperations.java similarity index 73% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksOperations.java index 38c7dcf8342fc..34f20bfad2b68 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksOperations.java @@ -8,126 +8,105 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Clusters. */ -public interface Clusters { +/** Resource collection API of VirtualnetworksOperations. */ +public interface VirtualnetworksOperations { /** - * List all HCI clusters in a subscription. - * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the virtualnetworks resource definition. */ - PagedIterable list(); + Virtualnetworks getByResourceGroup(String resourceGroupName, String virtualnetworksName); /** - * List all HCI clusters in a subscription. - * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the virtualnetworks resource definition along with {@link Response}. */ - PagedIterable list(Context context); + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualnetworksName, Context context); /** - * List all HCI clusters in a resource group. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void deleteByResourceGroup(String resourceGroupName, String virtualnetworksName); /** - * List all HCI clusters in a resource group. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualnetworksName The virtualnetworksName parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return the {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + Response deleteWithResponse(String resourceGroupName, String virtualnetworksName, Context context); /** - * Get HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return the paginated response with {@link PagedIterable}. */ - Cluster getByResourceGroup(String resourceGroupName, String clusterName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get HCI cluster. - * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @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 hCI cluster. + * @return the paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Delete an HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String clusterName); + PagedIterable list(); /** - * Delete an HCI cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. * @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 paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String clusterName, Context context); + PagedIterable list(Context context); /** - * Get HCI cluster. - * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return the virtualnetworks resource definition along with {@link Response}. */ - Cluster getById(String id); + Virtualnetworks getById(String id); /** - * Get HCI cluster. - * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return the virtualnetworks resource definition along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Delete an HCI cluster. - * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -136,22 +115,20 @@ public interface Clusters { void deleteById(String id); /** - * Delete an HCI cluster. - * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); /** - * Begins definition for a new Cluster resource. + * Begins definition for a new Virtualnetworks resource. * * @param name resource name. - * @return the first stage of the new Cluster definition. + * @return the first stage of the new Virtualnetworks definition. */ - Cluster.DefinitionStages.Blank define(String name); + Virtualnetworks.DefinitionStages.Blank define(String name); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksPatch.java new file mode 100644 index 0000000000000..a05fb4a2c5b47 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksPatch.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The virtualnetworks resource patch definition. */ +@Fluent +public final class VirtualnetworksPatch { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VirtualnetworksPatch object itself. + */ + public VirtualnetworksPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksPropertiesSubnetsItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksPropertiesSubnetsItem.java new file mode 100644 index 0000000000000..7baf18305a227 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksPropertiesSubnetsItem.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualnetworksPropertiesSubnetsItemAutoGenerated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet subnet in a virtual network resource. */ +@Fluent +public final class VirtualnetworksPropertiesSubnetsItem { + /* + * Name - The name of the resource that is unique within a resource group. + * This name can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * SubnetProperties - Properties of the subnet. + */ + @JsonProperty(value = "properties") + private VirtualnetworksPropertiesSubnetsItemAutoGenerated innerProperties; + + /** + * Get the name property: Name - The name of the resource that is unique within a resource group. This name can be + * used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name - The name of the resource that is unique within a resource group. This name can be + * used to access the resource. + * + * @param name the name value to set. + * @return the VirtualnetworksPropertiesSubnetsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: SubnetProperties - Properties of the subnet. + * + * @return the innerProperties value. + */ + private VirtualnetworksPropertiesSubnetsItemAutoGenerated innerProperties() { + return this.innerProperties; + } + + /** + * Get the addressPrefix property: Cidr for this subnet - IPv4, IPv6. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); + } + + /** + * Set the addressPrefix property: Cidr for this subnet - IPv4, IPv6. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualnetworksPropertiesSubnetsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItem withAddressPrefix(String addressPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the addressPrefixes property: AddressPrefixes - List of address prefixes for the subnet. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.innerProperties() == null ? null : this.innerProperties().addressPrefixes(); + } + + /** + * Set the addressPrefixes property: AddressPrefixes - List of address prefixes for the subnet. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the VirtualnetworksPropertiesSubnetsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItem withAddressPrefixes(List addressPrefixes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withAddressPrefixes(addressPrefixes); + return this; + } + + /** + * Get the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values + * include: 'Static', 'Dynamic'. + * + * @return the ipAllocationMethod value. + */ + public String ipAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().ipAllocationMethod(); + } + + /** + * Set the ipAllocationMethod property: IPAllocationMethod - The IP address allocation method. Possible values + * include: 'Static', 'Dynamic'. + * + * @param ipAllocationMethod the ipAllocationMethod value to set. + * @return the VirtualnetworksPropertiesSubnetsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItem withIpAllocationMethod(String ipAllocationMethod) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withIpAllocationMethod(ipAllocationMethod); + return this; + } + + /** + * Get the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. + * + * @return the ipConfigurationReferences value. + */ + public List< + ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems> + ipConfigurationReferences() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurationReferences(); + } + + /** + * Set the ipConfigurationReferences property: IPConfigurationReferences - list of IPConfigurationReferences. + * + * @param ipConfigurationReferences the ipConfigurationReferences value to set. + * @return the VirtualnetworksPropertiesSubnetsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItem withIpConfigurationReferences( + List< + ComponentsVqks9HSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesIpconfigurationreferencesItems> + ipConfigurationReferences) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withIpConfigurationReferences(ipConfigurationReferences); + return this; + } + + /** + * Get the routeTable property: RouteTable for the subnet. + * + * @return the routeTable value. + */ + public ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable() { + return this.innerProperties() == null ? null : this.innerProperties().routeTable(); + } + + /** + * Set the routeTable property: RouteTable for the subnet. + * + * @param routeTable the routeTable value to set. + * @return the VirtualnetworksPropertiesSubnetsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItem withRouteTable( + ComponentsL15GkaSchemasVirtualnetworkspropertiesPropertiesSubnetsItemsPropertiesRoutetable routeTable) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withRouteTable(routeTable); + return this; + } + + /** + * Get the ipPools property: network associated pool of IP Addresses. + * + * @return the ipPools value. + */ + public List ipPools() { + return this.innerProperties() == null ? null : this.innerProperties().ipPools(); + } + + /** + * Set the ipPools property: network associated pool of IP Addresses. + * + * @param ipPools the ipPools value to set. + * @return the VirtualnetworksPropertiesSubnetsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItem withIpPools(List ipPools) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withIpPools(ipPools); + return this; + } + + /** + * Get the vlan property: Vlan to use for the subnet. + * + * @return the vlan value. + */ + public Integer vlan() { + return this.innerProperties() == null ? null : this.innerProperties().vlan(); + } + + /** + * Set the vlan property: Vlan to use for the subnet. + * + * @param vlan the vlan value to set. + * @return the VirtualnetworksPropertiesSubnetsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsItem withVlan(Integer vlan) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksPropertiesSubnetsItemAutoGenerated(); + } + this.innerProperties().withVlan(vlan); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksPropertiesSubnetsPropertiesItemsItem.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksPropertiesSubnetsPropertiesItemsItem.java new file mode 100644 index 0000000000000..3016d2acb87df --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/VirtualnetworksPropertiesSubnetsPropertiesItemsItem.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route is associated with a subnet. */ +@Fluent +public final class VirtualnetworksPropertiesSubnetsPropertiesItemsItem { + /* + * Name - name of the subnet + */ + @JsonProperty(value = "name") + private String name; + + /* + * RoutePropertiesFormat - Properties of the route. + */ + @JsonProperty(value = "properties") + private VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem innerProperties; + + /** + * Get the name property: Name - name of the subnet. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name - name of the subnet. + * + * @param name the name value to set. + * @return the VirtualnetworksPropertiesSubnetsPropertiesItemsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: RoutePropertiesFormat - Properties of the route. + * + * @return the innerProperties value. + */ + private VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem innerProperties() { + return this.innerProperties; + } + + /** + * Get the addressPrefix property: AddressPrefix - The destination CIDR to which the route applies. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); + } + + /** + * Set the addressPrefix property: AddressPrefix - The destination CIDR to which the route applies. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualnetworksPropertiesSubnetsPropertiesItemsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsPropertiesItemsItem withAddressPrefix(String addressPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the nextHopIpAddress property: NextHopIPAddress - The IP address packets should be forwarded to. Next hop + * values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().nextHopIpAddress(); + } + + /** + * Set the nextHopIpAddress property: NextHopIPAddress - The IP address packets should be forwarded to. Next hop + * values are only allowed in routes where the next hop type is VirtualAppliance. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the VirtualnetworksPropertiesSubnetsPropertiesItemsItem object itself. + */ + public VirtualnetworksPropertiesSubnetsPropertiesItemsItem withNextHopIpAddress(String nextHopIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualnetworksPropertiesSubnetsItemRouteTableRoutesItem(); + } + this.innerProperties().withNextHopIpAddress(nextHopIpAddress); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b3a5f5ca93af1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationCreateOrUpdateSamples.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.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.GalleryimagesExtendedLocation; + +/** Samples for GalleryimagesOperation CreateOrUpdate. */ +public final class GalleryimagesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutGalleryImage.json + */ + /** + * Sample code: PutGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .galleryimagesOperations() + .define("test-gallery-image") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new GalleryimagesExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withContainerName("Default_Container") + .withImagePath("C:\\test.vhdx") + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationDeleteSamples.java new file mode 100644 index 0000000000000..139f3a40c3df0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationDeleteSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for GalleryimagesOperation Delete. */ +public final class GalleryimagesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteGalleryImage.json + */ + /** + * Sample code: DeleteGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryimagesOperations().deleteWithResponse("test-rg", "test-gallery-image", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..89b456e5877de --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationGetByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for GalleryimagesOperation GetByResourceGroup. */ +public final class GalleryimagesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetGalleryImage.json + */ + /** + * Sample code: GetGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryimagesOperations().getByResourceGroupWithResponse("test-rg", "test-gallery-image", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..bf06eda108746 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationListByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for GalleryimagesOperation ListByResourceGroup. */ +public final class GalleryimagesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListGalleryImageByResourceGroup.json + */ + /** + * Sample code: ListGalleryImageByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listGalleryImageByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryimagesOperations().listByResourceGroup("test-rg", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationListSamples.java new file mode 100644 index 0000000000000..bf484d53d4885 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationListSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for GalleryimagesOperation List. */ +public final class GalleryimagesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListGalleryImageBySubscription.json + */ + /** + * Sample code: ListGalleryImageByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listGalleryImageByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.galleryimagesOperations().list(Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationUpdateSamples.java new file mode 100644 index 0000000000000..c9e21fc716321 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/GalleryimagesOperationUpdateSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Galleryimages; +import java.util.HashMap; +import java.util.Map; + +/** Samples for GalleryimagesOperation Update. */ +public final class GalleryimagesOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateGalleryImage.json + */ + /** + * Sample code: UpdateGalleryImage. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateGalleryImage(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Galleryimages resource = + manager + .galleryimagesOperations() + .getByResourceGroupWithResponse("test-rg", "test-gallery-image", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..0f7a87d4375ef --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationCreateOrUpdateSamples.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.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.IpConfiguration; +import com.azure.resourcemanager.azurestackhci.models.IpConfigurationProperties; +import com.azure.resourcemanager.azurestackhci.models.IpConfigurationPropertiesSubnet; +import com.azure.resourcemanager.azurestackhci.models.NetworkinterfacesExtendedLocation; +import java.util.Arrays; + +/** Samples for NetworkinterfacesOperation CreateOrUpdate. */ +public final class NetworkinterfacesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutNetworkInterface.json + */ + /** + * Sample code: PutNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .networkinterfacesOperations() + .define("test-nic") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new NetworkinterfacesExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withIpConfigurations( + Arrays + .asList( + new IpConfiguration() + .withName("ipconfig-sample") + .withProperties( + new IpConfigurationProperties() + .withSubnet(new IpConfigurationPropertiesSubnet().withId("test-vnet"))))) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationDeleteSamples.java new file mode 100644 index 0000000000000..4bdac336f77a6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationDeleteSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for NetworkinterfacesOperation Delete. */ +public final class NetworkinterfacesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteNetworkInterface.json + */ + /** + * Sample code: DeleteNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkinterfacesOperations().deleteWithResponse("test-rg", "test-nic", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..a5913d919f5b4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationGetByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for NetworkinterfacesOperation GetByResourceGroup. */ +public final class NetworkinterfacesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetNetworkInterface.json + */ + /** + * Sample code: GetNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkinterfacesOperations().getByResourceGroupWithResponse("test-rg", "test-nic", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..dde231d26dcb4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationListByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for NetworkinterfacesOperation ListByResourceGroup. */ +public final class NetworkinterfacesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListNetworkInterfaceByResourceGroup.json + */ + /** + * Sample code: ListNetworkInterfaceByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listNetworkInterfaceByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkinterfacesOperations().listByResourceGroup("test-rg", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationListSamples.java new file mode 100644 index 0000000000000..d8e585f68f6d3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationListSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for NetworkinterfacesOperation List. */ +public final class NetworkinterfacesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListNetworkInterfaceBySubscription.json + */ + /** + * Sample code: ListNetworkInterfaceBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listNetworkInterfaceBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.networkinterfacesOperations().list(Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationUpdateSamples.java new file mode 100644 index 0000000000000..88736e41f409a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/NetworkinterfacesOperationUpdateSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Networkinterfaces; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkinterfacesOperation Update. */ +public final class NetworkinterfacesOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateNetworkInterface.json + */ + /** + * Sample code: UpdateNetworkInterface. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateNetworkInterface(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Networkinterfaces resource = + manager + .networkinterfacesOperations() + .getByResourceGroupWithResponse("test-rg", "test-nic", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..af46ae9b6913a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.StoragecontainersExtendedLocation; + +/** Samples for StoragecontainersOperation CreateOrUpdate. */ +public final class StoragecontainersOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutStorageContainer.json + */ + /** + * Sample code: PutStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .storagecontainersOperations() + .define("Default_Container") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new StoragecontainersExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withPath("C:\\container_storage") + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationDeleteSamples.java new file mode 100644 index 0000000000000..28c035ba7629c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationDeleteSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for StoragecontainersOperation Delete. */ +public final class StoragecontainersOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteStorageContainer.json + */ + /** + * Sample code: DeleteStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storagecontainersOperations().deleteWithResponse("test-rg", "Default_Container", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..8e375c38c7fa5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationGetByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for StoragecontainersOperation GetByResourceGroup. */ +public final class StoragecontainersOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetStorageContainer.json + */ + /** + * Sample code: GetStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .storagecontainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..05b75d2eb5661 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationListByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for StoragecontainersOperation ListByResourceGroup. */ +public final class StoragecontainersOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListStorageContainerByResourceGroup.json + */ + /** + * Sample code: ListStorageContainerByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listStorageContainerByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storagecontainersOperations().listByResourceGroup("test-rg", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationListSamples.java new file mode 100644 index 0000000000000..5f07c9cebea5a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationListSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for StoragecontainersOperation List. */ +public final class StoragecontainersOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListStorageContainerBySubscription.json + */ + /** + * Sample code: ListStorageContainerByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listStorageContainerByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.storagecontainersOperations().list(Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationUpdateSamples.java new file mode 100644 index 0000000000000..0124c8db74060 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/StoragecontainersOperationUpdateSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Storagecontainers; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StoragecontainersOperation Update. */ +public final class StoragecontainersOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateStorageContainer.json + */ + /** + * Sample code: UpdateStorageContainer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateStorageContainer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Storagecontainers resource = + manager + .storagecontainersOperations() + .getByResourceGroupWithResponse("test-rg", "Default_Container", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..132ff0a33b267 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.VirtualharddisksExtendedLocation; + +/** Samples for VirtualharddisksOperation CreateOrUpdate. */ +public final class VirtualharddisksOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutVirtualHardDisk.json + */ + /** + * Sample code: PutVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualharddisksOperations() + .define("test-vhd") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new VirtualharddisksExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withDiskSizeBytes(32L) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationDeleteSamples.java new file mode 100644 index 0000000000000..32223d5cf4963 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationDeleteSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualharddisksOperation Delete. */ +public final class VirtualharddisksOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteVirtualHardDisk.json + */ + /** + * Sample code: DeleteVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualharddisksOperations().deleteWithResponse("test-rg", "test-vhd", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..1aaa6069892b1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationGetByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualharddisksOperation GetByResourceGroup. */ +public final class VirtualharddisksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetVirtualHardDisk.json + */ + /** + * Sample code: GetVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualharddisksOperations().getByResourceGroupWithResponse("test-rg", "test-vhd", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..7ccf3070d3332 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationListByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualharddisksOperation ListByResourceGroup. */ +public final class VirtualharddisksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualHardDiskByResourceGroup.json + */ + /** + * Sample code: ListVirtualHardDiskByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualHardDiskByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualharddisksOperations().listByResourceGroup("test-rg", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationListSamples.java new file mode 100644 index 0000000000000..d7f140826c8ad --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationListSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualharddisksOperation List. */ +public final class VirtualharddisksOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualHardDiskBySubscription.json + */ + /** + * Sample code: ListVirtualHardDiskByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualHardDiskByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualharddisksOperations().list(Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationUpdateSamples.java new file mode 100644 index 0000000000000..5027f22503629 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualharddisksOperationUpdateSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Virtualharddisks; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualharddisksOperation Update. */ +public final class VirtualharddisksOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateVirtualHardDisk.json + */ + /** + * Sample code: UpdateVirtualHardDisk. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualHardDisk(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Virtualharddisks resource = + manager + .virtualharddisksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vhd", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..bb045d34bd09c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationCreateOrUpdateSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesExtendedLocation; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesHardwareProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesNetworkProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesOsProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesStorageProfile; +import com.azure.resourcemanager.azurestackhci.models.VirtualmachinesPropertiesStorageProfileImageReference; +import java.util.Arrays; + +/** Samples for VirtualmachinesOperation CreateOrUpdate. */ +public final class VirtualmachinesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutVirtualMachine.json + */ + /** + * Sample code: PutVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualmachinesOperations() + .define("test-vm") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new VirtualmachinesExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withHardwareProfile(new VirtualmachinesPropertiesHardwareProfile().withVmSize("Default")) + .withNetworkProfile( + new VirtualmachinesPropertiesNetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new VirtualmachinesPropertiesNetworkProfileNetworkInterfacesItem().withId("test-nic")))) + .withOsProfile( + new VirtualmachinesPropertiesOsProfile() + .withAdminPassword("password") + .withAdminUsername("localadmin") + .withComputerName("luamaster")) + .withStorageProfile( + new VirtualmachinesPropertiesStorageProfile() + .withImageReference( + new VirtualmachinesPropertiesStorageProfileImageReference().withName("test-gallery-image"))) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationDeleteSamples.java new file mode 100644 index 0000000000000..939cffaee4064 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationDeleteSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation Delete. */ +public final class VirtualmachinesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteVirtualMachine.json + */ + /** + * Sample code: DeleteVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().deleteWithResponse("test-rg", "test-vm", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..fbfc45a15e9e4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationGetByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation GetByResourceGroup. */ +public final class VirtualmachinesOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetVirtualMachine.json + */ + /** + * Sample code: GetVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().getByResourceGroupWithResponse("test-rg", "test-vm", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..0c3851739ef6b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationListByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation ListByResourceGroup. */ +public final class VirtualmachinesOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualMachineByResourceGroup.json + */ + /** + * Sample code: ListVirtualMachineByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualMachineByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().listByResourceGroup("test-rg", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationListSamples.java new file mode 100644 index 0000000000000..fcf93102f306e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationListSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation List. */ +public final class VirtualmachinesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualMachineBySubscription.json + */ + /** + * Sample code: ListVirtualMachineBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualMachineBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().list(Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationRestartSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationRestartSamples.java new file mode 100644 index 0000000000000..e381b6880e7cc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationRestartSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation Restart. */ +public final class VirtualmachinesOperationRestartSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/RestartVirtualMachine.json + */ + /** + * Sample code: RestartVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void restartVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().restart("test-rg", "test-vm", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationStartSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationStartSamples.java new file mode 100644 index 0000000000000..463027f262080 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationStartSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation Start. */ +public final class VirtualmachinesOperationStartSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/StartVirtualMachine.json + */ + /** + * Sample code: StartVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void startVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().start("test-rg", "test-vm", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationStopSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationStopSamples.java new file mode 100644 index 0000000000000..0f037e22b2d5f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationStopSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualmachinesOperation Stop. */ +public final class VirtualmachinesOperationStopSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/StopVirtualMachine.json + */ + /** + * Sample code: StopVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void stopVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualmachinesOperations().stop("test-rg", "test-vm", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationUpdateSamples.java new file mode 100644 index 0000000000000..4970050d5cfd2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualmachinesOperationUpdateSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Virtualmachines; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualmachinesOperation Update. */ +public final class VirtualmachinesOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateVirtualMachine.json + */ + /** + * Sample code: UpdateVirtualMachine. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualMachine(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Virtualmachines resource = + manager + .virtualmachinesOperations() + .getByResourceGroupWithResponse("test-rg", "test-vm", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationCreateOrUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..6afa17a5445d3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.VirtualnetworksExtendedLocation; + +/** Samples for VirtualnetworksOperation CreateOrUpdate. */ +public final class VirtualnetworksOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/PutVirtualNetwork.json + */ + /** + * Sample code: PutVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .virtualnetworksOperations() + .define("test-vnet") + .withRegion("West US2") + .withExistingResourceGroup("test-rg") + .withExtendedLocation( + new VirtualnetworksExtendedLocation() + .withType("CustomLocation") + .withName( + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")) + .withNetworkType("Transparent") + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationDeleteSamples.java new file mode 100644 index 0000000000000..d7cde47e50a4b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationDeleteSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualnetworksOperation Delete. */ +public final class VirtualnetworksOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/DeleteVirtualNetwork.json + */ + /** + * Sample code: DeleteVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualnetworksOperations().deleteWithResponse("test-rg", "test-vnet", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..6c1af96147aca --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationGetByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualnetworksOperation GetByResourceGroup. */ +public final class VirtualnetworksOperationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/GetVirtualNetwork.json + */ + /** + * Sample code: GetVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualnetworksOperations().getByResourceGroupWithResponse("test-rg", "test-vnet", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..09397b7144f49 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationListByResourceGroupSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualnetworksOperation ListByResourceGroup. */ +public final class VirtualnetworksOperationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualNetworkByResourceGroup.json + */ + /** + * Sample code: ListVirtualNetworkByResourceGroup. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualNetworkByResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualnetworksOperations().listByResourceGroup("test-rg", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationListSamples.java new file mode 100644 index 0000000000000..d1652ca8963d7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationListSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualnetworksOperation List. */ +public final class VirtualnetworksOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/ListVirtualNetworkBySubscription.json + */ + /** + * Sample code: ListVirtualNetworkBySubscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listVirtualNetworkBySubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.virtualnetworksOperations().list(Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationUpdateSamples.java new file mode 100644 index 0000000000000..775005a054eb9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/VirtualnetworksOperationUpdateSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Virtualnetworks; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualnetworksOperation Update. */ +public final class VirtualnetworksOperationUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2021-07-01-preview/examples/UpdateVirtualNetwork.json + */ + /** + * Sample code: UpdateVirtualNetwork. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateVirtualNetwork(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Virtualnetworks resource = + manager + .virtualnetworksOperations() + .getByResourceGroupWithResponse("test-rg", "test-vnet", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProperties", "sample")).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; + } +}