diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/CHANGELOG.md b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/CHANGELOG.md index c087f9b69d89..f560adbcfbb2 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/CHANGELOG.md +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2023-09-18) + +- Azure Resource Manager ConnectedVMware client library for Java. This package contains Microsoft Azure SDK for ConnectedVMware Management SDK. Connected VMware Client. Package tag package-2023-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/README.md b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/README.md index d189cc0291e2..ba8f91f2ed04 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/README.md +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ConnectedVMware client library for Java. -This package contains Microsoft Azure SDK for ConnectedVMware Management SDK. Connected VMware Client. Package tag package-2022-01-10-preview. 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 ConnectedVMware Management SDK. Connected VMware Client. Package tag package-2023-10. 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-connectedvmware - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,8 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fconnectedvmware%2Fazure-resourcemanager-connectedvmware%2FREADME.png) diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/SAMPLE.md b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/SAMPLE.md index b186529b1c70..3c1c3fb93c67 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/SAMPLE.md +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/SAMPLE.md @@ -19,13 +19,6 @@ - [ListByResourceGroup](#datastores_listbyresourcegroup) - [Update](#datastores_update) -## GuestAgents - -- [Create](#guestagents_create) -- [Delete](#guestagents_delete) -- [Get](#guestagents_get) -- [ListByVm](#guestagents_listbyvm) - ## Hosts - [Create](#hosts_create) @@ -35,13 +28,6 @@ - [ListByResourceGroup](#hosts_listbyresourcegroup) - [Update](#hosts_update) -## HybridIdentityMetadata - -- [Create](#hybrididentitymetadata_create) -- [Delete](#hybrididentitymetadata_delete) -- [Get](#hybrididentitymetadata_get) -- [ListByVm](#hybrididentitymetadata_listbyvm) - ## InventoryItems - [Create](#inventoryitems_create) @@ -49,14 +35,6 @@ - [Get](#inventoryitems_get) - [ListByVCenter](#inventoryitems_listbyvcenter) -## MachineExtensions - -- [CreateOrUpdate](#machineextensions_createorupdate) -- [Delete](#machineextensions_delete) -- [Get](#machineextensions_get) -- [List](#machineextensions_list) -- [Update](#machineextensions_update) - ## Operations - [List](#operations_list) @@ -79,6 +57,24 @@ - [ListByResourceGroup](#vcenters_listbyresourcegroup) - [Update](#vcenters_update) +## VMInstanceGuestAgents + +- [Create](#vminstanceguestagents_create) +- [Delete](#vminstanceguestagents_delete) +- [Get](#vminstanceguestagents_get) +- [List](#vminstanceguestagents_list) + +## VirtualMachineInstances + +- [CreateOrUpdate](#virtualmachineinstances_createorupdate) +- [Delete](#virtualmachineinstances_delete) +- [Get](#virtualmachineinstances_get) +- [List](#virtualmachineinstances_list) +- [Restart](#virtualmachineinstances_restart) +- [Start](#virtualmachineinstances_start) +- [Stop](#virtualmachineinstances_stop) +- [Update](#virtualmachineinstances_update) + ## VirtualMachineTemplates - [Create](#virtualmachinetemplates_create) @@ -88,20 +84,6 @@ - [ListByResourceGroup](#virtualmachinetemplates_listbyresourcegroup) - [Update](#virtualmachinetemplates_update) -## VirtualMachines - -- [AssessPatches](#virtualmachines_assesspatches) -- [Create](#virtualmachines_create) -- [Delete](#virtualmachines_delete) -- [GetByResourceGroup](#virtualmachines_getbyresourcegroup) -- [InstallPatches](#virtualmachines_installpatches) -- [List](#virtualmachines_list) -- [ListByResourceGroup](#virtualmachines_listbyresourcegroup) -- [Restart](#virtualmachines_restart) -- [Start](#virtualmachines_start) -- [Stop](#virtualmachines_stop) -- [Update](#virtualmachines_update) - ## VirtualNetworks - [Create](#virtualnetworks_create) @@ -110,6 +92,11 @@ - [List](#virtualnetworks_list) - [ListByResourceGroup](#virtualnetworks_listbyresourcegroup) - [Update](#virtualnetworks_update) + +## VmInstanceHybridIdentityMetadata + +- [Get](#vminstancehybrididentitymetadata_get) +- [List](#vminstancehybrididentitymetadata_list) ### Clusters_Create ```java @@ -118,7 +105,7 @@ import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; /** Samples for Clusters Create. */ public final class ClustersCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateCluster.json */ /** * Sample code: CreateCluster. @@ -147,12 +134,10 @@ public final class ClustersCreateSamples { ### Clusters_Delete ```java -import com.azure.core.util.Context; - /** Samples for Clusters Delete. */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteCluster.json */ /** * Sample code: DeleteCluster. @@ -160,7 +145,7 @@ public final class ClustersDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteCluster(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.clusters().delete("testrg", "HRCluster", null, Context.NONE); + manager.clusters().delete("testrg", "HRCluster", null, com.azure.core.util.Context.NONE); } } ``` @@ -168,12 +153,10 @@ public final class ClustersDeleteSamples { ### Clusters_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Clusters GetByResourceGroup. */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetCluster.json */ /** * Sample code: GetCluster. @@ -181,7 +164,7 @@ public final class ClustersGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getCluster(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.clusters().getByResourceGroupWithResponse("testrg", "HRCluster", Context.NONE); + manager.clusters().getByResourceGroupWithResponse("testrg", "HRCluster", com.azure.core.util.Context.NONE); } } ``` @@ -189,12 +172,10 @@ public final class ClustersGetByResourceGroupSamples { ### Clusters_List ```java -import com.azure.core.util.Context; - /** Samples for Clusters List. */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListClusters.json */ /** * Sample code: ListClusters. @@ -202,7 +183,7 @@ public final class ClustersListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listClusters(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.clusters().list(Context.NONE); + manager.clusters().list(com.azure.core.util.Context.NONE); } } ``` @@ -210,12 +191,10 @@ public final class ClustersListSamples { ### Clusters_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Clusters ListByResourceGroup. */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListClustersByResourceGroup.json */ /** * Sample code: ListClustersByResourceGroup. @@ -224,7 +203,7 @@ public final class ClustersListByResourceGroupSamples { */ public static void listClustersByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.clusters().listByResourceGroup("testrg", Context.NONE); + manager.clusters().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } ``` @@ -232,7 +211,6 @@ public final class ClustersListByResourceGroupSamples { ### Clusters_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.Cluster; import java.util.HashMap; import java.util.Map; @@ -240,7 +218,7 @@ import java.util.Map; /** Samples for Clusters Update. */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateCluster.json */ /** * Sample code: UpdateCluster. @@ -249,10 +227,14 @@ public final class ClustersUpdateSamples { */ public static void updateCluster(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { Cluster resource = - manager.clusters().getByResourceGroupWithResponse("testrg", "HRCluster", Context.NONE).getValue(); + manager + .clusters() + .getByResourceGroupWithResponse("testrg", "HRCluster", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -274,7 +256,7 @@ import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; /** Samples for Datastores Create. */ public final class DatastoresCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateDatastore.json */ /** * Sample code: CreateDatastore. @@ -303,12 +285,10 @@ public final class DatastoresCreateSamples { ### Datastores_Delete ```java -import com.azure.core.util.Context; - /** Samples for Datastores Delete. */ public final class DatastoresDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteDatastore.json */ /** * Sample code: DeleteDatastore. @@ -316,7 +296,7 @@ public final class DatastoresDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteDatastore(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.datastores().delete("testrg", "HRDatastore", null, Context.NONE); + manager.datastores().delete("testrg", "HRDatastore", null, com.azure.core.util.Context.NONE); } } ``` @@ -324,12 +304,10 @@ public final class DatastoresDeleteSamples { ### Datastores_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Datastores GetByResourceGroup. */ public final class DatastoresGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetDatastore.json */ /** * Sample code: GetDatastore. @@ -337,7 +315,7 @@ public final class DatastoresGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getDatastore(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.datastores().getByResourceGroupWithResponse("testrg", "HRDatastore", Context.NONE); + manager.datastores().getByResourceGroupWithResponse("testrg", "HRDatastore", com.azure.core.util.Context.NONE); } } ``` @@ -345,12 +323,10 @@ public final class DatastoresGetByResourceGroupSamples { ### Datastores_List ```java -import com.azure.core.util.Context; - /** Samples for Datastores List. */ public final class DatastoresListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListDatastores.json */ /** * Sample code: ListDatastores. @@ -358,7 +334,7 @@ public final class DatastoresListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listDatastores(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.datastores().list(Context.NONE); + manager.datastores().list(com.azure.core.util.Context.NONE); } } ``` @@ -366,12 +342,10 @@ public final class DatastoresListSamples { ### Datastores_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Datastores ListByResourceGroup. */ public final class DatastoresListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListDatastoresByResourceGroup.json */ /** * Sample code: ListDatastoresByResourceGroup. @@ -380,7 +354,7 @@ public final class DatastoresListByResourceGroupSamples { */ public static void listDatastoresByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.datastores().listByResourceGroup("testrg", Context.NONE); + manager.datastores().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } ``` @@ -388,7 +362,6 @@ public final class DatastoresListByResourceGroupSamples { ### Datastores_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.Datastore; import java.util.HashMap; import java.util.Map; @@ -396,7 +369,7 @@ import java.util.Map; /** Samples for Datastores Update. */ public final class DatastoresUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateDatastore.json */ /** * Sample code: UpdateDatastore. @@ -405,10 +378,14 @@ public final class DatastoresUpdateSamples { */ public static void updateDatastore(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { Datastore resource = - manager.datastores().getByResourceGroupWithResponse("testrg", "HRDatastore", Context.NONE).getValue(); + manager + .datastores() + .getByResourceGroupWithResponse("testrg", "HRDatastore", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -422,99 +399,6 @@ public final class DatastoresUpdateSamples { } ``` -### GuestAgents_Create - -```java -import com.azure.resourcemanager.connectedvmware.models.GuestCredential; -import com.azure.resourcemanager.connectedvmware.models.HttpProxyConfiguration; -import com.azure.resourcemanager.connectedvmware.models.ProvisioningAction; - -/** Samples for GuestAgents Create. */ -public final class GuestAgentsCreateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json - */ - /** - * Sample code: CreateGuestAgent. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void createGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager - .guestAgents() - .define("default") - .withExistingVirtualMachine("testrg", "ContosoVm") - .withCredentials(new GuestCredential().withUsername("tempuser").withPassword("")) - .withHttpProxyConfig(new HttpProxyConfiguration().withHttpsProxy("http://192.1.2.3:8080")) - .withProvisioningAction(ProvisioningAction.INSTALL) - .create(); - } -} -``` - -### GuestAgents_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for GuestAgents Delete. */ -public final class GuestAgentsDeleteSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json - */ - /** - * Sample code: DeleteGuestAgent. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void deleteGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.guestAgents().delete("testrg", "ContosoVm", "default", Context.NONE); - } -} -``` - -### GuestAgents_Get - -```java -import com.azure.core.util.Context; - -/** Samples for GuestAgents Get. */ -public final class GuestAgentsGetSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json - */ - /** - * Sample code: GetGuestAgent. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void getGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.guestAgents().getWithResponse("testrg", "ContosoVm", "default", Context.NONE); - } -} -``` - -### GuestAgents_ListByVm - -```java -import com.azure.core.util.Context; - -/** Samples for GuestAgents ListByVm. */ -public final class GuestAgentsListByVmSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GuestAgent_ListByVm.json - */ - /** - * Sample code: GuestAgentListByVm. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void guestAgentListByVm(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.guestAgents().listByVm("testrg", "ContosoVm", Context.NONE); - } -} -``` - ### Hosts_Create ```java @@ -523,7 +407,7 @@ import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; /** Samples for Hosts Create. */ public final class HostsCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHost.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateHost.json */ /** * Sample code: CreateHost. @@ -552,12 +436,10 @@ public final class HostsCreateSamples { ### Hosts_Delete ```java -import com.azure.core.util.Context; - /** Samples for Hosts Delete. */ public final class HostsDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHost.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteHost.json */ /** * Sample code: DeleteHost. @@ -565,7 +447,7 @@ public final class HostsDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteHost(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hosts().delete("testrg", "HRHost", null, Context.NONE); + manager.hosts().delete("testrg", "HRHost", null, com.azure.core.util.Context.NONE); } } ``` @@ -573,12 +455,10 @@ public final class HostsDeleteSamples { ### Hosts_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Hosts GetByResourceGroup. */ public final class HostsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHost.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetHost.json */ /** * Sample code: GetHost. @@ -586,7 +466,7 @@ public final class HostsGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getHost(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hosts().getByResourceGroupWithResponse("testrg", "HRHost", Context.NONE); + manager.hosts().getByResourceGroupWithResponse("testrg", "HRHost", com.azure.core.util.Context.NONE); } } ``` @@ -594,12 +474,10 @@ public final class HostsGetByResourceGroupSamples { ### Hosts_List ```java -import com.azure.core.util.Context; - /** Samples for Hosts List. */ public final class HostsListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHosts.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListHosts.json */ /** * Sample code: ListHosts. @@ -607,7 +485,7 @@ public final class HostsListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listHosts(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hosts().list(Context.NONE); + manager.hosts().list(com.azure.core.util.Context.NONE); } } ``` @@ -615,12 +493,10 @@ public final class HostsListSamples { ### Hosts_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Hosts ListByResourceGroup. */ public final class HostsListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHostsByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListHostsByResourceGroup.json */ /** * Sample code: ListHostsByResourceGroup. @@ -629,7 +505,7 @@ public final class HostsListByResourceGroupSamples { */ public static void listHostsByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hosts().listByResourceGroup("testrg", Context.NONE); + manager.hosts().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } ``` @@ -637,7 +513,6 @@ public final class HostsListByResourceGroupSamples { ### Hosts_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.HostModel; import java.util.HashMap; import java.util.Map; @@ -645,7 +520,7 @@ import java.util.Map; /** Samples for Hosts Update. */ public final class HostsUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateHost.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateHost.json */ /** * Sample code: UpdateHost. @@ -654,10 +529,14 @@ public final class HostsUpdateSamples { */ public static void updateHost(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { HostModel resource = - manager.hosts().getByResourceGroupWithResponse("testrg", "HRHost", Context.NONE).getValue(); + manager + .hosts() + .getByResourceGroupWithResponse("testrg", "HRHost", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -671,105 +550,15 @@ public final class HostsUpdateSamples { } ``` -### HybridIdentityMetadata_Create - -```java -/** Samples for HybridIdentityMetadata Create. */ -public final class HybridIdentityMetadataCreateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHybridIdentityMetadata.json - */ - /** - * Sample code: CreateHybridIdentityMetadata. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void createHybridIdentityMetadata( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager - .hybridIdentityMetadatas() - .define("default") - .withExistingVirtualMachine("testrg", "ContosoVm") - .withVmId("f8b82dff-38ef-4220-99ef-d3a3f86ddc6c") - .withPublicKey("8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2") - .create(); - } -} -``` - -### HybridIdentityMetadata_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for HybridIdentityMetadata Delete. */ -public final class HybridIdentityMetadataDeleteSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHybridIdentityMetadata.json - */ - /** - * Sample code: DeleteHybridIdentityMetadata. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void deleteHybridIdentityMetadata( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hybridIdentityMetadatas().deleteWithResponse("testrg", "ContosoVm", "default", Context.NONE); - } -} -``` - -### HybridIdentityMetadata_Get - -```java -import com.azure.core.util.Context; - -/** Samples for HybridIdentityMetadata Get. */ -public final class HybridIdentityMetadataGetSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHybridIdentityMetadata.json - */ - /** - * Sample code: GetHybridIdentityMetadata. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void getHybridIdentityMetadata( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hybridIdentityMetadatas().getWithResponse("testrg", "ContosoVm", "default", Context.NONE); - } -} -``` - -### HybridIdentityMetadata_ListByVm - -```java -import com.azure.core.util.Context; - -/** Samples for HybridIdentityMetadata ListByVm. */ -public final class HybridIdentityMetadataListByVmSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/HybridIdentityMetadata_ListByVm.json - */ - /** - * Sample code: HybridIdentityMetadataListByVm. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void hybridIdentityMetadataListByVm( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hybridIdentityMetadatas().listByVm("testrg", "ContosoVm", Context.NONE); - } -} -``` - ### InventoryItems_Create ```java +import com.azure.resourcemanager.connectedvmware.models.ResourcePoolInventoryItem; + /** Samples for InventoryItems Create. */ public final class InventoryItemsCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateInventoryItem.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateInventoryItem.json */ /** * Sample code: CreateInventoryItem. @@ -777,7 +566,12 @@ public final class InventoryItemsCreateSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void createInventoryItem(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.inventoryItems().define("testItem").withExistingVcenter("testrg", "ContosoVCenter").create(); + manager + .inventoryItems() + .define("testItem") + .withExistingVcenter("testrg", "ContosoVCenter") + .withProperties(new ResourcePoolInventoryItem()) + .create(); } } ``` @@ -785,12 +579,10 @@ public final class InventoryItemsCreateSamples { ### InventoryItems_Delete ```java -import com.azure.core.util.Context; - /** Samples for InventoryItems Delete. */ public final class InventoryItemsDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteInventoryItem.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteInventoryItem.json */ /** * Sample code: DeleteInventoryItem. @@ -798,7 +590,9 @@ public final class InventoryItemsDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteInventoryItem(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.inventoryItems().deleteWithResponse("testrg", "ContosoVCenter", "testItem", Context.NONE); + manager + .inventoryItems() + .deleteWithResponse("testrg", "ContosoVCenter", "testItem", com.azure.core.util.Context.NONE); } } ``` @@ -806,12 +600,10 @@ public final class InventoryItemsDeleteSamples { ### InventoryItems_Get ```java -import com.azure.core.util.Context; - /** Samples for InventoryItems Get. */ public final class InventoryItemsGetSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetInventoryItem.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetInventoryItem.json */ /** * Sample code: GetInventoryItem. @@ -819,7 +611,9 @@ public final class InventoryItemsGetSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getInventoryItem(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.inventoryItems().getWithResponse("testrg", "ContosoVCenter", "testItem", Context.NONE); + manager + .inventoryItems() + .getWithResponse("testrg", "ContosoVCenter", "testItem", com.azure.core.util.Context.NONE); } } ``` @@ -827,12 +621,10 @@ public final class InventoryItemsGetSamples { ### InventoryItems_ListByVCenter ```java -import com.azure.core.util.Context; - /** Samples for InventoryItems ListByVCenter. */ public final class InventoryItemsListByVCenterSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/InventoryItems_ListByVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/InventoryItems_ListByVCenter.json */ /** * Sample code: InventoryItemsListByVCenter. @@ -841,158 +633,7 @@ public final class InventoryItemsListByVCenterSamples { */ public static void inventoryItemsListByVCenter( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.inventoryItems().listByVCenter("testrg", "ContosoVCenter", Context.NONE); - } -} -``` - -### MachineExtensions_CreateOrUpdate - -```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - -/** Samples for MachineExtensions CreateOrUpdate. */ -public final class MachineExtensionsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/PUTExtension.json - */ - /** - * Sample code: Create or Update a Machine Extension (PUT). - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void createOrUpdateAMachineExtensionPUT( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) throws IOException { - manager - .machineExtensions() - .define("CustomScriptExtension") - .withRegion("eastus2euap") - .withExistingVirtualMachine("myResourceGroup", "myMachine") - .withPublisher("Microsoft.Compute") - .withTypePropertiesType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt 10000" - + " }\\\"\"}", - Object.class, - SerializerEncoding.JSON)) - .create(); - } -} -``` - -### MachineExtensions_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for MachineExtensions Delete. */ -public final class MachineExtensionsDeleteSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DELETEExtension.json - */ - /** - * Sample code: Delete a Machine Extension. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void deleteAMachineExtension( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.machineExtensions().delete("myResourceGroup", "myMachine", "MMA", Context.NONE); - } -} -``` - -### MachineExtensions_Get - -```java -import com.azure.core.util.Context; - -/** Samples for MachineExtensions Get. */ -public final class MachineExtensionsGetSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GETExtension.json - */ - /** - * Sample code: Get Machine Extension. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void getMachineExtension(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager - .machineExtensions() - .getWithResponse("myResourceGroup", "myMachine", "CustomScriptExtension", Context.NONE); - } -} -``` - -### MachineExtensions_List - -```java -import com.azure.core.util.Context; - -/** Samples for MachineExtensions List. */ -public final class MachineExtensionsListSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/LISTExtension.json - */ - /** - * Sample code: Get all Machine Extensions. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void getAllMachineExtensions( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.machineExtensions().list("myResourceGroup", "myMachine", null, Context.NONE); - } -} -``` - -### MachineExtensions_Update - -```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.connectedvmware.models.MachineExtension; -import java.io.IOException; - -/** Samples for MachineExtensions Update. */ -public final class MachineExtensionsUpdateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateExtension.json - */ - /** - * Sample code: Create or Update a Machine Extension (PATCH). - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void createOrUpdateAMachineExtensionPATCH( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) throws IOException { - MachineExtension resource = - manager - .machineExtensions() - .getWithResponse("myResourceGroup", "myMachine", "CustomScriptExtension", Context.NONE) - .getValue(); - resource - .update() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt 100" - + " }\\\"\"}", - Object.class, - SerializerEncoding.JSON)) - .apply(); + manager.inventoryItems().listByVCenter("testrg", "ContosoVCenter", com.azure.core.util.Context.NONE); } } ``` @@ -1000,12 +641,10 @@ public final class MachineExtensionsUpdateSamples { ### Operations_List ```java -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListOperations.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListOperations.json */ /** * Sample code: ListOperations. @@ -1013,7 +652,7 @@ public final class OperationsListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listOperations(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -1026,7 +665,7 @@ import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; /** Samples for ResourcePools Create. */ public final class ResourcePoolsCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateResourcePool.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateResourcePool.json */ /** * Sample code: CreateResourcePool. @@ -1055,12 +694,10 @@ public final class ResourcePoolsCreateSamples { ### ResourcePools_Delete ```java -import com.azure.core.util.Context; - /** Samples for ResourcePools Delete. */ public final class ResourcePoolsDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteResourcePool.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteResourcePool.json */ /** * Sample code: DeleteResourcePool. @@ -1068,7 +705,7 @@ public final class ResourcePoolsDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteResourcePool(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.resourcePools().delete("testrg", "HRPool", null, Context.NONE); + manager.resourcePools().delete("testrg", "HRPool", null, com.azure.core.util.Context.NONE); } } ``` @@ -1076,12 +713,10 @@ public final class ResourcePoolsDeleteSamples { ### ResourcePools_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ResourcePools GetByResourceGroup. */ public final class ResourcePoolsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetResourcePool.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetResourcePool.json */ /** * Sample code: GetResourcePool. @@ -1089,7 +724,7 @@ public final class ResourcePoolsGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getResourcePool(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.resourcePools().getByResourceGroupWithResponse("testrg", "HRPool", Context.NONE); + manager.resourcePools().getByResourceGroupWithResponse("testrg", "HRPool", com.azure.core.util.Context.NONE); } } ``` @@ -1097,12 +732,10 @@ public final class ResourcePoolsGetByResourceGroupSamples { ### ResourcePools_List ```java -import com.azure.core.util.Context; - /** Samples for ResourcePools List. */ public final class ResourcePoolsListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePools.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListResourcePools.json */ /** * Sample code: ListResourcePools. @@ -1110,7 +743,7 @@ public final class ResourcePoolsListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listResourcePools(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.resourcePools().list(Context.NONE); + manager.resourcePools().list(com.azure.core.util.Context.NONE); } } ``` @@ -1118,12 +751,10 @@ public final class ResourcePoolsListSamples { ### ResourcePools_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ResourcePools ListByResourceGroup. */ public final class ResourcePoolsListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePoolsByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListResourcePoolsByResourceGroup.json */ /** * Sample code: ListResourcePoolsByResourceGroup. @@ -1132,7 +763,7 @@ public final class ResourcePoolsListByResourceGroupSamples { */ public static void listResourcePoolsByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.resourcePools().listByResourceGroup("testrg", Context.NONE); + manager.resourcePools().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } ``` @@ -1140,7 +771,6 @@ public final class ResourcePoolsListByResourceGroupSamples { ### ResourcePools_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.ResourcePool; import java.util.HashMap; import java.util.Map; @@ -1148,7 +778,7 @@ import java.util.Map; /** Samples for ResourcePools Update. */ public final class ResourcePoolsUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateResourcePool.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateResourcePool.json */ /** * Sample code: UpdateResourcePool. @@ -1157,10 +787,14 @@ public final class ResourcePoolsUpdateSamples { */ public static void updateResourcePool(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { ResourcePool resource = - manager.resourcePools().getByResourceGroupWithResponse("testrg", "HRPool", Context.NONE).getValue(); + manager + .resourcePools() + .getByResourceGroupWithResponse("testrg", "HRPool", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1183,7 +817,7 @@ import com.azure.resourcemanager.connectedvmware.models.VICredential; /** Samples for VCenters Create. */ public final class VCentersCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVCenter.json */ /** * Sample code: CreateVCenter. @@ -1203,7 +837,7 @@ public final class VCentersCreateSamples { .withName( "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso")) .withPort(1234) - .withCredentials(new VICredential().withUsername("tempuser").withPassword("")) + .withCredentials(new VICredential().withUsername("tempuser").withPassword("fakeTokenPlaceholder")) .create(); } } @@ -1212,12 +846,10 @@ public final class VCentersCreateSamples { ### VCenters_Delete ```java -import com.azure.core.util.Context; - /** Samples for VCenters Delete. */ public final class VCentersDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVCenter.json */ /** * Sample code: DeleteVCenter. @@ -1225,7 +857,7 @@ public final class VCentersDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteVCenter(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.vCenters().delete("testrg", "ContosoVCenter", null, Context.NONE); + manager.vCenters().delete("testrg", "ContosoVCenter", null, com.azure.core.util.Context.NONE); } } ``` @@ -1233,12 +865,10 @@ public final class VCentersDeleteSamples { ### VCenters_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for VCenters GetByResourceGroup. */ public final class VCentersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVCenter.json */ /** * Sample code: GetVCenter. @@ -1246,7 +876,7 @@ public final class VCentersGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getVCenter(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.vCenters().getByResourceGroupWithResponse("testrg", "ContosoVCenter", Context.NONE); + manager.vCenters().getByResourceGroupWithResponse("testrg", "ContosoVCenter", com.azure.core.util.Context.NONE); } } ``` @@ -1254,12 +884,10 @@ public final class VCentersGetByResourceGroupSamples { ### VCenters_List ```java -import com.azure.core.util.Context; - /** Samples for VCenters List. */ public final class VCentersListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCenters.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVCenters.json */ /** * Sample code: ListVCenters. @@ -1267,7 +895,7 @@ public final class VCentersListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listVCenters(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.vCenters().list(Context.NONE); + manager.vCenters().list(com.azure.core.util.Context.NONE); } } ``` @@ -1275,12 +903,10 @@ public final class VCentersListSamples { ### VCenters_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for VCenters ListByResourceGroup. */ public final class VCentersListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCentersByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVCentersByResourceGroup.json */ /** * Sample code: ListVCentersByResourceGroup. @@ -1289,7 +915,7 @@ public final class VCentersListByResourceGroupSamples { */ public static void listVCentersByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.vCenters().listByResourceGroup("testrg", Context.NONE); + manager.vCenters().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } ``` @@ -1297,7 +923,6 @@ public final class VCentersListByResourceGroupSamples { ### VCenters_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.VCenter; import java.util.HashMap; import java.util.Map; @@ -1305,7 +930,7 @@ import java.util.Map; /** Samples for VCenters Update. */ public final class VCentersUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVCenter.json */ /** * Sample code: UpdateVCenter. @@ -1314,10 +939,14 @@ public final class VCentersUpdateSamples { */ public static void updateVCenter(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { VCenter resource = - manager.vCenters().getByResourceGroupWithResponse("testrg", "ContosoVCenter", Context.NONE).getValue(); + manager + .vCenters() + .getByResourceGroupWithResponse("testrg", "ContosoVCenter", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1331,450 +960,474 @@ public final class VCentersUpdateSamples { } ``` -### VirtualMachineTemplates_Create +### VMInstanceGuestAgents_Create ```java -import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.connectedvmware.models.GuestCredential; +import com.azure.resourcemanager.connectedvmware.models.HttpProxyConfiguration; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningAction; -/** Samples for VirtualMachineTemplates Create. */ -public final class VirtualMachineTemplatesCreateSamples { +/** Samples for VMInstanceGuestAgents Create. */ +public final class VMInstanceGuestAgentsCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachineTemplate.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVMInstanceGuestAgent.json */ /** - * Sample code: CreateVirtualMachineTemplate. + * Sample code: CreateGuestAgent. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void createVirtualMachineTemplate( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + public static void createGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { manager - .virtualMachineTemplates() - .define("WebFrontEndTemplate") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso")) - .withVCenterId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter") - .withMoRefId("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") - .create(); + .vMInstanceGuestAgents() + .create( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + new GuestAgentInner() + .withCredentials( + new GuestCredential().withUsername("tempuser").withPassword("fakeTokenPlaceholder")) + .withPrivateLinkScopeResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName") + .withHttpProxyConfig(new HttpProxyConfiguration().withHttpsProxy("http://192.1.2.3:8080")) + .withProvisioningAction(ProvisioningAction.INSTALL), + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachineTemplates_Delete +### VMInstanceGuestAgents_Delete ```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates Delete. */ -public final class VirtualMachineTemplatesDeleteSamples { +/** Samples for VMInstanceGuestAgents Delete. */ +public final class VMInstanceGuestAgentsDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachineTemplate.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVMInstanceGuestAgent.json */ /** - * Sample code: DeleteVirtualMachineTemplate. + * Sample code: DeleteGuestAgent. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void deleteVirtualMachineTemplate( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachineTemplates().delete("testrg", "WebFrontEndTemplate", null, Context.NONE); + public static void deleteGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .vMInstanceGuestAgents() + .delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachineTemplates_GetByResourceGroup +### VMInstanceGuestAgents_Get ```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates GetByResourceGroup. */ -public final class VirtualMachineTemplatesGetByResourceGroupSamples { +/** Samples for VMInstanceGuestAgents Get. */ +public final class VMInstanceGuestAgentsGetSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachineTemplate.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVMInstanceGuestAgent.json */ /** - * Sample code: GetVirtualMachineTemplate. + * Sample code: GetGuestAgent. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void getVirtualMachineTemplate( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachineTemplates().getByResourceGroupWithResponse("testrg", "WebFrontEndTemplate", Context.NONE); + public static void getGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .vMInstanceGuestAgents() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachineTemplates_List +### VMInstanceGuestAgents_List ```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates List. */ -public final class VirtualMachineTemplatesListSamples { +/** Samples for VMInstanceGuestAgents List. */ +public final class VMInstanceGuestAgentsListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplates.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/VMInstanceGuestAgent_ListByVm.json */ /** - * Sample code: ListVirtualMachineTemplates. + * Sample code: GuestAgentListByVm. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void listVirtualMachineTemplates( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachineTemplates().list(Context.NONE); + public static void guestAgentListByVm(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .vMInstanceGuestAgents() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachineTemplates_ListByResourceGroup +### VirtualMachineInstances_CreateOrUpdate ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; +import com.azure.resourcemanager.connectedvmware.models.InfrastructureProfile; +import com.azure.resourcemanager.connectedvmware.models.PlacementProfile; -/** Samples for VirtualMachineTemplates ListByResourceGroup. */ -public final class VirtualMachineTemplatesListByResourceGroupSamples { +/** Samples for VirtualMachineInstances CreateOrUpdate. */ +public final class VirtualMachineInstancesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVirtualMachineInstance.json */ /** - * Sample code: ListVirtualMachineTemplatesByResourceGroup. + * Sample code: CreateVirtualMachine. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void listVirtualMachineTemplatesByResourceGroup( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachineTemplates().listByResourceGroup("testrg", Context.NONE); + public static void createVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withType("customLocation") + .withName( + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso")) + .withPlacementProfile( + new PlacementProfile() + .withResourcePoolId( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool")) + .withHardwareProfile(new HardwareProfile().withMemorySizeMB(4196).withNumCPUs(4)) + .withInfrastructureProfile( + new InfrastructureProfile() + .withTemplateId( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate") + .withVCenterId( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter")), + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachineTemplates_Update +### VirtualMachineInstances_Delete ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineTemplate; -import java.util.HashMap; -import java.util.Map; - -/** Samples for VirtualMachineTemplates Update. */ -public final class VirtualMachineTemplatesUpdateSamples { +/** Samples for VirtualMachineInstances Delete. */ +public final class VirtualMachineInstancesDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachineTemplate.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVirtualMachineInstance.json */ /** - * Sample code: UpdateVirtualMachineTemplate. + * Sample code: DeleteVirtualMachine. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void updateVirtualMachineTemplate( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - VirtualMachineTemplate resource = - manager - .virtualMachineTemplates() - .getByResourceGroupWithResponse("testrg", "WebFrontEndTemplate", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + public static void deleteVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineInstances() + .delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + null, + null, + com.azure.core.util.Context.NONE); } +} +``` - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; +### VirtualMachineInstances_Get + +```java +/** Samples for VirtualMachineInstances Get. */ +public final class VirtualMachineInstancesGetSamples { + /* + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVirtualMachineInstance.json + */ + /** + * Sample code: GetVirtualMachine. + * + * @param manager Entry point to ConnectedVMwareManager. + */ + public static void getVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineInstances() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_AssessPatches +### VirtualMachineInstances_List ```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines AssessPatches. */ -public final class VirtualMachinesAssessPatchesSamples { +/** Samples for VirtualMachineInstances List. */ +public final class VirtualMachineInstancesListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineAssessPatches.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualMachineInstances.json */ /** - * Sample code: Assess patch state of a machine. + * Sample code: GetVirtualMachine. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void assessPatchStateOfAMachine( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().assessPatches("myResourceGroupName", "myMachineName", Context.NONE); + public static void getVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineInstances() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_Create +### VirtualMachineInstances_Restart ```java -import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; -import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; - -/** Samples for VirtualMachines Create. */ -public final class VirtualMachinesCreateSamples { +/** Samples for VirtualMachineInstances Restart. */ +public final class VirtualMachineInstancesRestartSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/RestartVirtualMachineInstance.json */ /** - * Sample code: CreateVirtualMachine. + * Sample code: RestartVirtualMachine. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void createVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + public static void restartVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { manager - .virtualMachines() - .define("DemoVM") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso")) - .withResourcePoolId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool") - .withTemplateId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate") - .withVCenterId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter") - .withHardwareProfile(new HardwareProfile().withMemorySizeMB(4196).withNumCPUs(4)) - .create(); + .virtualMachineInstances() + .restart( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_Delete +### VirtualMachineInstances_Start ```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Delete. */ -public final class VirtualMachinesDeleteSamples { +/** Samples for VirtualMachineInstances Start. */ +public final class VirtualMachineInstancesStartSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/StartVirtualMachineInstance.json */ /** - * Sample code: DeleteVirtualMachine. + * Sample code: StartVirtualMachine. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void deleteVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().delete("testrg", "DemoVM", null, null, Context.NONE); + public static void startVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineInstances() + .start( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_GetByResourceGroup +### VirtualMachineInstances_Stop ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; -/** Samples for VirtualMachines GetByResourceGroup. */ -public final class VirtualMachinesGetByResourceGroupSamples { +/** Samples for VirtualMachineInstances Stop. */ +public final class VirtualMachineInstancesStopSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/StopVirtualMachineInstance.json */ /** - * Sample code: GetVirtualMachine. + * Sample code: StopVirtualMachine. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void getVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().getByResourceGroupWithResponse("testrg", "DemoVM", Context.NONE); + public static void stopVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineInstances() + .stop( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + new StopVirtualMachineOptions().withSkipShutdown(true), + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_InstallPatches +### VirtualMachineInstances_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.models.VMGuestPatchClassificationWindows; -import com.azure.resourcemanager.connectedvmware.models.VMGuestPatchRebootSetting; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstallPatchesParameters; -import com.azure.resourcemanager.connectedvmware.models.WindowsParameters; -import java.time.OffsetDateTime; -import java.util.Arrays; - -/** Samples for VirtualMachines InstallPatches. */ -public final class VirtualMachinesInstallPatchesSamples { +import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstanceUpdate; + +/** Samples for VirtualMachineInstances Update. */ +public final class VirtualMachineInstancesUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineInstallPatches.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVirtualMachineInstance.json */ /** - * Sample code: Install patch state of a machine. + * Sample code: UpdateVirtualMachine. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void installPatchStateOfAMachine( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + public static void updateVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { manager - .virtualMachines() - .installPatches( - "myResourceGroupName", - "myMachineName", - new VirtualMachineInstallPatchesParameters() - .withMaximumDuration("PT3H") - .withRebootSetting(VMGuestPatchRebootSetting.IF_REQUIRED) - .withWindowsParameters( - new WindowsParameters() - .withClassificationsToInclude( - Arrays - .asList( - VMGuestPatchClassificationWindows.CRITICAL, - VMGuestPatchClassificationWindows.SECURITY)) - .withMaxPatchPublishDate(OffsetDateTime.parse("2022-01-15T02:36:43.0539904+00:00"))), - Context.NONE); + .virtualMachineInstances() + .update( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceUpdate() + .withHardwareProfile(new HardwareProfile().withMemorySizeMB(4196).withNumCPUs(4)), + com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_List +### VirtualMachineTemplates_Create ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; -/** Samples for VirtualMachines List. */ -public final class VirtualMachinesListSamples { +/** Samples for VirtualMachineTemplates Create. */ +public final class VirtualMachineTemplatesCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachines.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVirtualMachineTemplate.json */ /** - * Sample code: ListVirtualMachines. + * Sample code: CreateVirtualMachineTemplate. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void listVirtualMachines(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().list(Context.NONE); + public static void createVirtualMachineTemplate( + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineTemplates() + .define("WebFrontEndTemplate") + .withRegion("East US") + .withExistingResourceGroup("testrg") + .withExtendedLocation( + new ExtendedLocation() + .withType("customLocation") + .withName( + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso")) + .withVCenterId( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter") + .withMoRefId("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") + .create(); } } ``` -### VirtualMachines_ListByResourceGroup +### VirtualMachineTemplates_Delete ```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines ListByResourceGroup. */ -public final class VirtualMachinesListByResourceGroupSamples { +/** Samples for VirtualMachineTemplates Delete. */ +public final class VirtualMachineTemplatesDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachinesByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVirtualMachineTemplate.json */ /** - * Sample code: ListVirtualMachinesByResourceGroup. + * Sample code: DeleteVirtualMachineTemplate. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void listVirtualMachinesByResourceGroup( + public static void deleteVirtualMachineTemplate( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().listByResourceGroup("testrg", Context.NONE); + manager + .virtualMachineTemplates() + .delete("testrg", "WebFrontEndTemplate", null, com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_Restart +### VirtualMachineTemplates_GetByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Restart. */ -public final class VirtualMachinesRestartSamples { +/** Samples for VirtualMachineTemplates GetByResourceGroup. */ +public final class VirtualMachineTemplatesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/RestartVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVirtualMachineTemplate.json */ /** - * Sample code: RestartVirtualMachine. + * Sample code: GetVirtualMachineTemplate. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void restartVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().restart("testrg", "DemoVM", Context.NONE); + public static void getVirtualMachineTemplate( + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineTemplates() + .getByResourceGroupWithResponse("testrg", "WebFrontEndTemplate", com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_Start +### VirtualMachineTemplates_List ```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Start. */ -public final class VirtualMachinesStartSamples { +/** Samples for VirtualMachineTemplates List. */ +public final class VirtualMachineTemplatesListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StartVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualMachineTemplates.json */ /** - * Sample code: StartVirtualMachine. + * Sample code: ListVirtualMachineTemplates. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void startVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().start("testrg", "DemoVM", Context.NONE); + public static void listVirtualMachineTemplates( + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager.virtualMachineTemplates().list(com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_Stop +### VirtualMachineTemplates_ListByResourceGroup ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; - -/** Samples for VirtualMachines Stop. */ -public final class VirtualMachinesStopSamples { +/** Samples for VirtualMachineTemplates ListByResourceGroup. */ +public final class VirtualMachineTemplatesListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StopVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualMachineTemplatesByResourceGroup.json */ /** - * Sample code: StopVirtualMachine. + * Sample code: ListVirtualMachineTemplatesByResourceGroup. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void stopVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager - .virtualMachines() - .stop("testrg", "DemoVM", new StopVirtualMachineOptions().withSkipShutdown(true), Context.NONE); + public static void listVirtualMachineTemplatesByResourceGroup( + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager.virtualMachineTemplates().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_Update +### VirtualMachineTemplates_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachine; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineTemplate; import java.util.HashMap; import java.util.Map; -/** Samples for VirtualMachines Update. */ -public final class VirtualMachinesUpdateSamples { +/** Samples for VirtualMachineTemplates Update. */ +public final class VirtualMachineTemplatesUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVirtualMachineTemplate.json */ /** - * Sample code: UpdateVirtualMachine. + * Sample code: UpdateVirtualMachineTemplate. * * @param manager Entry point to ConnectedVMwareManager. */ - public static void updateVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - VirtualMachine resource = - manager.virtualMachines().getByResourceGroupWithResponse("testrg", "DemoVM", Context.NONE).getValue(); + public static void updateVirtualMachineTemplate( + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + VirtualMachineTemplate resource = + manager + .virtualMachineTemplates() + .getByResourceGroupWithResponse("testrg", "WebFrontEndTemplate", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1796,7 +1449,7 @@ import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; /** Samples for VirtualNetworks Create. */ public final class VirtualNetworksCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualNetwork.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVirtualNetwork.json */ /** * Sample code: CreateVirtualNetwork. @@ -1825,12 +1478,10 @@ public final class VirtualNetworksCreateSamples { ### VirtualNetworks_Delete ```java -import com.azure.core.util.Context; - /** Samples for VirtualNetworks Delete. */ public final class VirtualNetworksDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualNetwork.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVirtualNetwork.json */ /** * Sample code: DeleteVirtualNetwork. @@ -1838,7 +1489,7 @@ public final class VirtualNetworksDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteVirtualNetwork(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualNetworks().delete("testrg", "ProdNetwork", null, Context.NONE); + manager.virtualNetworks().delete("testrg", "ProdNetwork", null, com.azure.core.util.Context.NONE); } } ``` @@ -1846,12 +1497,10 @@ public final class VirtualNetworksDeleteSamples { ### VirtualNetworks_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for VirtualNetworks GetByResourceGroup. */ public final class VirtualNetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualNetwork.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVirtualNetwork.json */ /** * Sample code: GetVirtualNetwork. @@ -1859,7 +1508,9 @@ public final class VirtualNetworksGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getVirtualNetwork(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualNetworks().getByResourceGroupWithResponse("testrg", "ProdNetwork", Context.NONE); + manager + .virtualNetworks() + .getByResourceGroupWithResponse("testrg", "ProdNetwork", com.azure.core.util.Context.NONE); } } ``` @@ -1867,12 +1518,10 @@ public final class VirtualNetworksGetByResourceGroupSamples { ### VirtualNetworks_List ```java -import com.azure.core.util.Context; - /** Samples for VirtualNetworks List. */ public final class VirtualNetworksListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworks.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualNetworks.json */ /** * Sample code: ListVirtualNetworks. @@ -1880,7 +1529,7 @@ public final class VirtualNetworksListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listVirtualNetworks(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualNetworks().list(Context.NONE); + manager.virtualNetworks().list(com.azure.core.util.Context.NONE); } } ``` @@ -1888,12 +1537,10 @@ public final class VirtualNetworksListSamples { ### VirtualNetworks_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for VirtualNetworks ListByResourceGroup. */ public final class VirtualNetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworksByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualNetworksByResourceGroup.json */ /** * Sample code: ListVirtualNetworksByResourceGroup. @@ -1902,7 +1549,7 @@ public final class VirtualNetworksListByResourceGroupSamples { */ public static void listVirtualNetworksByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualNetworks().listByResourceGroup("testrg", Context.NONE); + manager.virtualNetworks().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } ``` @@ -1910,7 +1557,6 @@ public final class VirtualNetworksListByResourceGroupSamples { ### VirtualNetworks_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.VirtualNetwork; import java.util.HashMap; import java.util.Map; @@ -1918,7 +1564,7 @@ import java.util.Map; /** Samples for VirtualNetworks Update. */ public final class VirtualNetworksUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualNetwork.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVirtualNetwork.json */ /** * Sample code: UpdateVirtualNetwork. @@ -1927,10 +1573,14 @@ public final class VirtualNetworksUpdateSamples { */ public static void updateVirtualNetwork(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { VirtualNetwork resource = - manager.virtualNetworks().getByResourceGroupWithResponse("testrg", "ProdNetwork", Context.NONE).getValue(); + manager + .virtualNetworks() + .getByResourceGroupWithResponse("testrg", "ProdNetwork", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1944,3 +1594,51 @@ public final class VirtualNetworksUpdateSamples { } ``` +### VmInstanceHybridIdentityMetadata_Get + +```java +/** Samples for VmInstanceHybridIdentityMetadata Get. */ +public final class VmInstanceHybridIdentityMetadataGetSamples { + /* + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVmInstanceHybridIdentityMetadata.json + */ + /** + * Sample code: GetHybridIdentityMetadata. + * + * @param manager Entry point to ConnectedVMwareManager. + */ + public static void getHybridIdentityMetadata( + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .vmInstanceHybridIdentityMetadatas() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} +``` + +### VmInstanceHybridIdentityMetadata_List + +```java +/** Samples for VmInstanceHybridIdentityMetadata List. */ +public final class VmInstanceHybridIdentityMetadataListSamples { + /* + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/HybridIdentityMetadata_ListByVmInstance.json + */ + /** + * Sample code: HybridIdentityMetadataListByVm. + * + * @param manager Entry point to ConnectedVMwareManager. + */ + public static void hybridIdentityMetadataListByVm( + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .vmInstanceHybridIdentityMetadatas() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml index 9225d33ab602..c060833bfcc6 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for ConnectedVMware Management - This package contains Microsoft Azure SDK for ConnectedVMware Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Connected VMware Client. Package tag package-2022-01-10-preview. + This package contains Microsoft Azure SDK for ConnectedVMware Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Connected VMware Client. Package tag package-2023-10. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/ConnectedVMwareManager.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/ConnectedVMwareManager.java index e6afc24349f7..a28f7b601639 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/ConnectedVMwareManager.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/ConnectedVMwareManager.java @@ -27,30 +27,28 @@ import com.azure.resourcemanager.connectedvmware.implementation.ClustersImpl; import com.azure.resourcemanager.connectedvmware.implementation.ConnectedVMwareClientBuilder; import com.azure.resourcemanager.connectedvmware.implementation.DatastoresImpl; -import com.azure.resourcemanager.connectedvmware.implementation.GuestAgentsImpl; import com.azure.resourcemanager.connectedvmware.implementation.HostsImpl; -import com.azure.resourcemanager.connectedvmware.implementation.HybridIdentityMetadatasImpl; import com.azure.resourcemanager.connectedvmware.implementation.InventoryItemsImpl; -import com.azure.resourcemanager.connectedvmware.implementation.MachineExtensionsImpl; import com.azure.resourcemanager.connectedvmware.implementation.OperationsImpl; import com.azure.resourcemanager.connectedvmware.implementation.ResourcePoolsImpl; import com.azure.resourcemanager.connectedvmware.implementation.VCentersImpl; +import com.azure.resourcemanager.connectedvmware.implementation.VMInstanceGuestAgentsImpl; +import com.azure.resourcemanager.connectedvmware.implementation.VirtualMachineInstancesImpl; import com.azure.resourcemanager.connectedvmware.implementation.VirtualMachineTemplatesImpl; -import com.azure.resourcemanager.connectedvmware.implementation.VirtualMachinesImpl; import com.azure.resourcemanager.connectedvmware.implementation.VirtualNetworksImpl; +import com.azure.resourcemanager.connectedvmware.implementation.VmInstanceHybridIdentityMetadatasImpl; import com.azure.resourcemanager.connectedvmware.models.Clusters; import com.azure.resourcemanager.connectedvmware.models.Datastores; -import com.azure.resourcemanager.connectedvmware.models.GuestAgents; import com.azure.resourcemanager.connectedvmware.models.Hosts; -import com.azure.resourcemanager.connectedvmware.models.HybridIdentityMetadatas; import com.azure.resourcemanager.connectedvmware.models.InventoryItems; -import com.azure.resourcemanager.connectedvmware.models.MachineExtensions; import com.azure.resourcemanager.connectedvmware.models.Operations; import com.azure.resourcemanager.connectedvmware.models.ResourcePools; import com.azure.resourcemanager.connectedvmware.models.VCenters; +import com.azure.resourcemanager.connectedvmware.models.VMInstanceGuestAgents; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstances; import com.azure.resourcemanager.connectedvmware.models.VirtualMachineTemplates; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachines; import com.azure.resourcemanager.connectedvmware.models.VirtualNetworks; +import com.azure.resourcemanager.connectedvmware.models.VmInstanceHybridIdentityMetadatas; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -62,8 +60,6 @@ public final class ConnectedVMwareManager { private Operations operations; - private VirtualMachines virtualMachines; - private ResourcePools resourcePools; private Clusters clusters; @@ -80,11 +76,11 @@ public final class ConnectedVMwareManager { private InventoryItems inventoryItems; - private HybridIdentityMetadatas hybridIdentityMetadatas; + private VirtualMachineInstances virtualMachineInstances; - private MachineExtensions machineExtensions; + private VmInstanceHybridIdentityMetadatas vmInstanceHybridIdentityMetadatas; - private GuestAgents guestAgents; + private VMInstanceGuestAgents vMInstanceGuestAgents; private final ConnectedVMwareClient clientObject; @@ -320,18 +316,6 @@ public Operations operations() { return operations; } - /** - * Gets the resource collection API of VirtualMachines. It manages VirtualMachine. - * - * @return Resource collection API of VirtualMachines. - */ - public VirtualMachines virtualMachines() { - if (this.virtualMachines == null) { - this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); - } - return virtualMachines; - } - /** * Gets the resource collection API of ResourcePools. It manages ResourcePool. * @@ -430,45 +414,48 @@ public InventoryItems inventoryItems() { } /** - * Gets the resource collection API of HybridIdentityMetadatas. It manages HybridIdentityMetadata. + * Gets the resource collection API of VirtualMachineInstances. * - * @return Resource collection API of HybridIdentityMetadatas. + * @return Resource collection API of VirtualMachineInstances. */ - public HybridIdentityMetadatas hybridIdentityMetadatas() { - if (this.hybridIdentityMetadatas == null) { - this.hybridIdentityMetadatas = - new HybridIdentityMetadatasImpl(clientObject.getHybridIdentityMetadatas(), this); + public VirtualMachineInstances virtualMachineInstances() { + if (this.virtualMachineInstances == null) { + this.virtualMachineInstances = + new VirtualMachineInstancesImpl(clientObject.getVirtualMachineInstances(), this); } - return hybridIdentityMetadatas; + return virtualMachineInstances; } /** - * Gets the resource collection API of MachineExtensions. It manages MachineExtension. + * Gets the resource collection API of VmInstanceHybridIdentityMetadatas. * - * @return Resource collection API of MachineExtensions. + * @return Resource collection API of VmInstanceHybridIdentityMetadatas. */ - public MachineExtensions machineExtensions() { - if (this.machineExtensions == null) { - this.machineExtensions = new MachineExtensionsImpl(clientObject.getMachineExtensions(), this); + public VmInstanceHybridIdentityMetadatas vmInstanceHybridIdentityMetadatas() { + if (this.vmInstanceHybridIdentityMetadatas == null) { + this.vmInstanceHybridIdentityMetadatas = + new VmInstanceHybridIdentityMetadatasImpl(clientObject.getVmInstanceHybridIdentityMetadatas(), this); } - return machineExtensions; + return vmInstanceHybridIdentityMetadatas; } /** - * Gets the resource collection API of GuestAgents. It manages GuestAgent. + * Gets the resource collection API of VMInstanceGuestAgents. * - * @return Resource collection API of GuestAgents. + * @return Resource collection API of VMInstanceGuestAgents. */ - public GuestAgents guestAgents() { - if (this.guestAgents == null) { - this.guestAgents = new GuestAgentsImpl(clientObject.getGuestAgents(), this); + public VMInstanceGuestAgents vMInstanceGuestAgents() { + if (this.vMInstanceGuestAgents == null) { + this.vMInstanceGuestAgents = new VMInstanceGuestAgentsImpl(clientObject.getVMInstanceGuestAgents(), this); } - return guestAgents; + return vMInstanceGuestAgents; } /** - * @return Wrapped service client ConnectedVMwareClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets wrapped service client ConnectedVMwareClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client ConnectedVMwareClient. */ public ConnectedVMwareClient serviceClient() { return this.clientObject; diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ClustersClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ClustersClient.java index b5313492e80e..a292231083cd 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ClustersClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ClustersClient.java @@ -23,15 +23,13 @@ public interface ClustersClient { * * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 define the cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ClusterInner> beginCreate( - String resourceGroupName, String clusterName, ClusterInner body); + SyncPoller, ClusterInner> beginCreate(String resourceGroupName, String clusterName); /** * Implements cluster PUT method. @@ -51,22 +49,6 @@ SyncPoller, ClusterInner> beginCreate( SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner body, Context context); - /** - * Implements cluster PUT method. - * - *

Create Or Update cluster. - * - * @param resourceGroupName The Resource Group Name. - * @param clusterName Name of the cluster. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner create(String resourceGroupName, String clusterName, ClusterInner body); - /** * Implements cluster PUT method. * @@ -99,21 +81,6 @@ SyncPoller, ClusterInner> beginCreate( @ServiceMethod(returns = ReturnType.SINGLE) ClusterInner create(String resourceGroupName, String clusterName, ClusterInner body, Context context); - /** - * Gets a cluster. - * - *

Implements cluster GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param clusterName 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 define the cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); - /** * Gets a cluster. * @@ -132,9 +99,9 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String clusterName, Context context); /** - * Updates a cluster. + * Gets a cluster. * - *

API to update certain properties of the cluster resource. + *

Implements cluster GET method. * * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. @@ -144,7 +111,7 @@ Response getByResourceGroupWithResponse( * @return define the cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner update(String resourceGroupName, String clusterName); + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); /** * Updates a cluster. @@ -165,20 +132,19 @@ Response updateWithResponse( String resourceGroupName, String clusterName, ResourcePatch body, Context context); /** - * Deletes an cluster. + * Updates a cluster. * - *

Implements cluster DELETE method. + *

API to update certain properties of the cluster resource. * * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return define the cluster. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Boolean force); + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update(String resourceGroupName, String clusterName); /** * Deletes an cluster. @@ -187,16 +153,13 @@ Response updateWithResponse( * * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. - * @param force Whether force delete was specified. - * @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> beginDelete( - String resourceGroupName, String clusterName, Boolean force, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); /** * Deletes an cluster. @@ -206,12 +169,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. * @param force Whether force delete was specified. + * @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.SINGLE) - void delete(String resourceGroupName, String clusterName, Boolean force); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, Boolean force, Context context); /** * Deletes an cluster. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ConnectedVMwareClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ConnectedVMwareClient.java index 877d0bcb11f4..fe14c08c89f3 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ConnectedVMwareClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ConnectedVMwareClient.java @@ -51,13 +51,6 @@ public interface ConnectedVMwareClient { */ OperationsClient getOperations(); - /** - * Gets the VirtualMachinesClient object to access its operations. - * - * @return the VirtualMachinesClient object. - */ - VirtualMachinesClient getVirtualMachines(); - /** * Gets the ResourcePoolsClient object to access its operations. * @@ -115,23 +108,23 @@ public interface ConnectedVMwareClient { InventoryItemsClient getInventoryItems(); /** - * Gets the HybridIdentityMetadatasClient object to access its operations. + * Gets the VirtualMachineInstancesClient object to access its operations. * - * @return the HybridIdentityMetadatasClient object. + * @return the VirtualMachineInstancesClient object. */ - HybridIdentityMetadatasClient getHybridIdentityMetadatas(); + VirtualMachineInstancesClient getVirtualMachineInstances(); /** - * Gets the MachineExtensionsClient object to access its operations. + * Gets the VmInstanceHybridIdentityMetadatasClient object to access its operations. * - * @return the MachineExtensionsClient object. + * @return the VmInstanceHybridIdentityMetadatasClient object. */ - MachineExtensionsClient getMachineExtensions(); + VmInstanceHybridIdentityMetadatasClient getVmInstanceHybridIdentityMetadatas(); /** - * Gets the GuestAgentsClient object to access its operations. + * Gets the VMInstanceGuestAgentsClient object to access its operations. * - * @return the GuestAgentsClient object. + * @return the VMInstanceGuestAgentsClient object. */ - GuestAgentsClient getGuestAgents(); + VMInstanceGuestAgentsClient getVMInstanceGuestAgents(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/DatastoresClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/DatastoresClient.java index 7fe1441579bf..accc5bd57e9e 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/DatastoresClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/DatastoresClient.java @@ -23,15 +23,13 @@ public interface DatastoresClient { * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 define the datastore. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DatastoreInner> beginCreate( - String resourceGroupName, String datastoreName, DatastoreInner body); + SyncPoller, DatastoreInner> beginCreate(String resourceGroupName, String datastoreName); /** * Implements datastore PUT method. @@ -51,22 +49,6 @@ SyncPoller, DatastoreInner> beginCreate( SyncPoller, DatastoreInner> beginCreate( String resourceGroupName, String datastoreName, DatastoreInner body, Context context); - /** - * Implements datastore PUT method. - * - *

Create Or Update datastore. - * - * @param resourceGroupName The Resource Group Name. - * @param datastoreName Name of the datastore. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the datastore. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DatastoreInner create(String resourceGroupName, String datastoreName, DatastoreInner body); - /** * Implements datastore PUT method. * @@ -99,21 +81,6 @@ SyncPoller, DatastoreInner> beginCreate( @ServiceMethod(returns = ReturnType.SINGLE) DatastoreInner create(String resourceGroupName, String datastoreName, DatastoreInner body, Context context); - /** - * Gets a datastore. - * - *

Implements datastore GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param datastoreName Name of the datastore. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the datastore. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DatastoreInner getByResourceGroup(String resourceGroupName, String datastoreName); - /** * Gets a datastore. * @@ -132,9 +99,9 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String datastoreName, Context context); /** - * Updates a datastore. + * Gets a datastore. * - *

API to update certain properties of the datastore resource. + *

Implements datastore GET method. * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. @@ -144,7 +111,7 @@ Response getByResourceGroupWithResponse( * @return define the datastore. */ @ServiceMethod(returns = ReturnType.SINGLE) - DatastoreInner update(String resourceGroupName, String datastoreName); + DatastoreInner getByResourceGroup(String resourceGroupName, String datastoreName); /** * Updates a datastore. @@ -165,20 +132,19 @@ Response updateWithResponse( String resourceGroupName, String datastoreName, ResourcePatch body, Context context); /** - * Deletes an datastore. + * Updates a datastore. * - *

Implements datastore DELETE method. + *

API to update certain properties of the datastore resource. * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return define the datastore. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String datastoreName, Boolean force); + @ServiceMethod(returns = ReturnType.SINGLE) + DatastoreInner update(String resourceGroupName, String datastoreName); /** * Deletes an datastore. @@ -187,16 +153,13 @@ Response updateWithResponse( * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. - * @param force Whether force delete was specified. - * @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> beginDelete( - String resourceGroupName, String datastoreName, Boolean force, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String datastoreName); /** * Deletes an datastore. @@ -206,12 +169,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. * @param force Whether force delete was specified. + * @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.SINGLE) - void delete(String resourceGroupName, String datastoreName, Boolean force); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String datastoreName, Boolean force, Context context); /** * Deletes an datastore. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/HostsClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/HostsClient.java index 73f4dfa0485c..a948e9406b3b 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/HostsClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/HostsClient.java @@ -23,15 +23,13 @@ public interface HostsClient { * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 define the host. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, HostModelInner> beginCreate( - String resourceGroupName, String hostname, HostModelInner body); + SyncPoller, HostModelInner> beginCreate(String resourceGroupName, String hostname); /** * Implements host PUT method. @@ -51,22 +49,6 @@ SyncPoller, HostModelInner> beginCreate( SyncPoller, HostModelInner> beginCreate( String resourceGroupName, String hostname, HostModelInner body, Context context); - /** - * Implements host PUT method. - * - *

Create Or Update host. - * - * @param resourceGroupName The Resource Group Name. - * @param hostname Name of the host. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HostModelInner create(String resourceGroupName, String hostname, HostModelInner body); - /** * Implements host PUT method. * @@ -106,13 +88,14 @@ SyncPoller, HostModelInner> beginCreate( * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. + * @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 define the host. + * @return define the host along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - HostModelInner getByResourceGroup(String resourceGroupName, String hostname); + Response getByResourceGroupWithResponse(String resourceGroupName, String hostname, Context context); /** * Gets a host. @@ -121,14 +104,13 @@ SyncPoller, HostModelInner> beginCreate( * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. - * @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 define the host along with {@link Response}. + * @return define the host. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String hostname, Context context); + HostModelInner getByResourceGroup(String resourceGroupName, String hostname); /** * Updates a host. @@ -137,13 +119,16 @@ SyncPoller, HostModelInner> beginCreate( * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. + * @param body Resource properties to update. + * @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 define the host. + * @return define the host along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - HostModelInner update(String resourceGroupName, String hostname); + Response updateWithResponse( + String resourceGroupName, String hostname, ResourcePatch body, Context context); /** * Updates a host. @@ -152,16 +137,13 @@ SyncPoller, HostModelInner> beginCreate( * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. - * @param body Resource properties to update. - * @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 define the host along with {@link Response}. + * @return define the host. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String hostname, ResourcePatch body, Context context); + HostModelInner update(String resourceGroupName, String hostname); /** * Deletes an host. @@ -170,14 +152,13 @@ Response updateWithResponse( * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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> beginDelete(String resourceGroupName, String hostname, Boolean force); + SyncPoller, Void> beginDelete(String resourceGroupName, String hostname); /** * Deletes an host. @@ -197,21 +178,6 @@ Response updateWithResponse( SyncPoller, Void> beginDelete( String resourceGroupName, String hostname, Boolean force, Context context); - /** - * Deletes an host. - * - *

Implements host DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param hostname Name of the host. - * @param force Whether force delete was specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 hostname, Boolean force); - /** * Deletes an host. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/HybridIdentityMetadatasClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/HybridIdentityMetadatasClient.java deleted file mode 100644 index f9134bf7bfbd..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/HybridIdentityMetadatasClient.java +++ /dev/null @@ -1,153 +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.connectedvmware.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.fluent.models.HybridIdentityMetadataInner; - -/** An instance of this class provides access to all the operations defined in HybridIdentityMetadatasClient. */ -public interface HybridIdentityMetadatasClient { - /** - * Implements HybridIdentityMetadata PUT method. - * - *

Create Or Update HybridIdentityMetadata. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the hybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridIdentityMetadataInner create(String resourceGroupName, String virtualMachineName, String metadataName); - - /** - * Implements HybridIdentityMetadata PUT method. - * - *

Create Or Update HybridIdentityMetadata. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the hybridIdentityMetadata. - * @param body Request payload. - * @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 defines the HybridIdentityMetadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String virtualMachineName, - String metadataName, - HybridIdentityMetadataInner body, - Context context); - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HybridIdentityMetadataInner get(String resourceGroupName, String virtualMachineName, String metadataName); - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @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 defines the HybridIdentityMetadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String virtualMachineName, String metadataName, Context context); - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 virtualMachineName, String metadataName); - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @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 virtualMachineName, String metadataName, Context context); - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVm(String resourceGroupName, String virtualMachineName); - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVm( - String resourceGroupName, String virtualMachineName, Context context); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/InventoryItemsClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/InventoryItemsClient.java index da745b366c0a..58d79d0caca5 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/InventoryItemsClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/InventoryItemsClient.java @@ -13,22 +13,6 @@ /** An instance of this class provides access to all the operations defined in InventoryItemsClient. */ public interface InventoryItemsClient { - /** - * Implements InventoryItem PUT method. - * - *

Create Or Update InventoryItem. - * - * @param resourceGroupName The Resource Group Name. - * @param vcenterName Name of the vCenter. - * @param inventoryItemName Name of the inventoryItem. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InventoryItemInner create(String resourceGroupName, String vcenterName, String inventoryItemName); - /** * Implements InventoryItem PUT method. * @@ -53,9 +37,9 @@ Response createWithResponse( Context context); /** - * Gets InventoryItem. + * Implements InventoryItem PUT method. * - *

Implements InventoryItem GET method. + *

Create Or Update InventoryItem. * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. @@ -66,7 +50,7 @@ Response createWithResponse( * @return defines the inventory item. */ @ServiceMethod(returns = ReturnType.SINGLE) - InventoryItemInner get(String resourceGroupName, String vcenterName, String inventoryItemName); + InventoryItemInner create(String resourceGroupName, String vcenterName, String inventoryItemName); /** * Gets InventoryItem. @@ -87,9 +71,9 @@ Response getWithResponse( String resourceGroupName, String vcenterName, String inventoryItemName, Context context); /** - * Deletes an inventoryItem. + * Gets InventoryItem. * - *

Implements inventoryItem DELETE method. + *

Implements InventoryItem GET method. * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. @@ -97,9 +81,10 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the inventory item. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vcenterName, String inventoryItemName); + InventoryItemInner get(String resourceGroupName, String vcenterName, String inventoryItemName); /** * Deletes an inventoryItem. @@ -119,6 +104,21 @@ Response getWithResponse( Response deleteWithResponse( String resourceGroupName, String vcenterName, String inventoryItemName, Context context); + /** + * Deletes an inventoryItem. + * + *

Implements inventoryItem DELETE method. + * + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @param inventoryItemName Name of the inventoryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vcenterName, String inventoryItemName); + /** * Implements GET inventoryItems in a vCenter. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/MachineExtensionsClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/MachineExtensionsClient.java deleted file mode 100644 index c691bacf7cc1..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/MachineExtensionsClient.java +++ /dev/null @@ -1,281 +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.connectedvmware.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.connectedvmware.fluent.models.MachineExtensionInner; -import com.azure.resourcemanager.connectedvmware.models.MachineExtensionUpdate; - -/** An instance of this class provides access to all the operations defined in MachineExtensionsClient. */ -public interface MachineExtensionsClient { - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension 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 describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MachineExtensionInner> beginCreateOrUpdate( - String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters); - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MachineExtensionInner> beginCreateOrUpdate( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionInner extensionParameters, - Context context); - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MachineExtensionInner createOrUpdate( - String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters); - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MachineExtensionInner createOrUpdate( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionInner extensionParameters, - Context context); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension 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 describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MachineExtensionInner> beginUpdate( - String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MachineExtensionInner> beginUpdate( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionUpdate extensionParameters, - Context context); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MachineExtensionInner update( - String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters); - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MachineExtensionInner update( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionUpdate extensionParameters, - Context context); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginDelete(String resourceGroupName, String name, String extensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String name, String extensionName, Context context); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 name, String extensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String name, String extensionName, Context context); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MachineExtensionInner get(String resourceGroupName, String name, String extensionName); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String name, String extensionName, Context context); - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String name); - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String name, String expand, Context context); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ResourcePoolsClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ResourcePoolsClient.java index 88bc57f636ca..a17ac95a45ab 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ResourcePoolsClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/ResourcePoolsClient.java @@ -23,7 +23,6 @@ public interface ResourcePoolsClient { * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -31,7 +30,7 @@ public interface ResourcePoolsClient { */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ResourcePoolInner> beginCreate( - String resourceGroupName, String resourcePoolName, ResourcePoolInner body); + String resourceGroupName, String resourcePoolName); /** * Implements resourcePool PUT method. @@ -51,22 +50,6 @@ SyncPoller, ResourcePoolInner> beginCreate( SyncPoller, ResourcePoolInner> beginCreate( String resourceGroupName, String resourcePoolName, ResourcePoolInner body, Context context); - /** - * Implements resourcePool PUT method. - * - *

Create Or Update resourcePool. - * - * @param resourceGroupName The Resource Group Name. - * @param resourcePoolName Name of the resourcePool. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the resourcePool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourcePoolInner create(String resourceGroupName, String resourcePoolName, ResourcePoolInner body); - /** * Implements resourcePool PUT method. * @@ -100,21 +83,6 @@ SyncPoller, ResourcePoolInner> beginCreate( ResourcePoolInner create( String resourceGroupName, String resourcePoolName, ResourcePoolInner body, Context context); - /** - * Gets a resourcePool. - * - *

Implements resourcePool GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param resourcePoolName Name of the resourcePool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the resourcePool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourcePoolInner getByResourceGroup(String resourceGroupName, String resourcePoolName); - /** * Gets a resourcePool. * @@ -133,9 +101,9 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String resourcePoolName, Context context); /** - * Updates a resourcePool. + * Gets a resourcePool. * - *

API to update certain properties of the resourcePool resource. + *

Implements resourcePool GET method. * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. @@ -145,7 +113,7 @@ Response getByResourceGroupWithResponse( * @return define the resourcePool. */ @ServiceMethod(returns = ReturnType.SINGLE) - ResourcePoolInner update(String resourceGroupName, String resourcePoolName); + ResourcePoolInner getByResourceGroup(String resourceGroupName, String resourcePoolName); /** * Updates a resourcePool. @@ -166,20 +134,19 @@ Response updateWithResponse( String resourceGroupName, String resourcePoolName, ResourcePatch body, Context context); /** - * Deletes an resourcePool. + * Updates a resourcePool. * - *

Implements resourcePool DELETE method. + *

API to update certain properties of the resourcePool resource. * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return define the resourcePool. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourcePoolName, Boolean force); + @ServiceMethod(returns = ReturnType.SINGLE) + ResourcePoolInner update(String resourceGroupName, String resourcePoolName); /** * Deletes an resourcePool. @@ -188,16 +155,13 @@ Response updateWithResponse( * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. - * @param force Whether force delete was specified. - * @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> beginDelete( - String resourceGroupName, String resourcePoolName, Boolean force, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String resourcePoolName); /** * Deletes an resourcePool. @@ -207,12 +171,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. * @param force Whether force delete was specified. + * @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.SINGLE) - void delete(String resourceGroupName, String resourcePoolName, Boolean force); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourcePoolName, Boolean force, Context context); /** * Deletes an resourcePool. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VCentersClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VCentersClient.java index 40b608d9d089..206bdf7c0a0f 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VCentersClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VCentersClient.java @@ -23,15 +23,13 @@ public interface VCentersClient { * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 defines the vCenter. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VCenterInner> beginCreate( - String resourceGroupName, String vcenterName, VCenterInner body); + SyncPoller, VCenterInner> beginCreate(String resourceGroupName, String vcenterName); /** * Implements vCenter PUT method. @@ -51,22 +49,6 @@ SyncPoller, VCenterInner> beginCreate( SyncPoller, VCenterInner> beginCreate( String resourceGroupName, String vcenterName, VCenterInner body, Context context); - /** - * Implements vCenter PUT method. - * - *

Create Or Update vCenter. - * - * @param resourceGroupName The Resource Group Name. - * @param vcenterName Name of the vCenter. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the vCenter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VCenterInner create(String resourceGroupName, String vcenterName, VCenterInner body); - /** * Implements vCenter PUT method. * @@ -99,21 +81,6 @@ SyncPoller, VCenterInner> beginCreate( @ServiceMethod(returns = ReturnType.SINGLE) VCenterInner create(String resourceGroupName, String vcenterName, VCenterInner body, Context context); - /** - * Gets a vCenter. - * - *

Implements vCenter GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param vcenterName Name of the vCenter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the vCenter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VCenterInner getByResourceGroup(String resourceGroupName, String vcenterName); - /** * Gets a vCenter. * @@ -132,9 +99,9 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String vcenterName, Context context); /** - * Updates a vCenter. + * Gets a vCenter. * - *

API to update certain properties of the vCenter resource. + *

Implements vCenter GET method. * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. @@ -144,7 +111,7 @@ Response getByResourceGroupWithResponse( * @return defines the vCenter. */ @ServiceMethod(returns = ReturnType.SINGLE) - VCenterInner update(String resourceGroupName, String vcenterName); + VCenterInner getByResourceGroup(String resourceGroupName, String vcenterName); /** * Updates a vCenter. @@ -165,20 +132,19 @@ Response updateWithResponse( String resourceGroupName, String vcenterName, ResourcePatch body, Context context); /** - * Deletes an vCenter. + * Updates a vCenter. * - *

Implements vCenter DELETE method. + *

API to update certain properties of the vCenter resource. * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return defines the vCenter. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String vcenterName, Boolean force); + @ServiceMethod(returns = ReturnType.SINGLE) + VCenterInner update(String resourceGroupName, String vcenterName); /** * Deletes an vCenter. @@ -187,16 +153,13 @@ Response updateWithResponse( * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. - * @param force Whether force delete was specified. - * @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> beginDelete( - String resourceGroupName, String vcenterName, Boolean force, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String vcenterName); /** * Deletes an vCenter. @@ -206,12 +169,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param force Whether force delete was specified. + * @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.SINGLE) - void delete(String resourceGroupName, String vcenterName, Boolean force); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vcenterName, Boolean force, Context context); /** * Deletes an vCenter. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/GuestAgentsClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VMInstanceGuestAgentsClient.java similarity index 66% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/GuestAgentsClient.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VMInstanceGuestAgentsClient.java index 3fba83864bea..6135ae3f2fb1 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/GuestAgentsClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VMInstanceGuestAgentsClient.java @@ -13,34 +13,30 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner; -/** An instance of this class provides access to all the operations defined in GuestAgentsClient. */ -public interface GuestAgentsClient { +/** An instance of this class provides access to all the operations defined in VMInstanceGuestAgentsClient. */ +public interface VMInstanceGuestAgentsClient { /** * Implements GuestAgent PUT method. * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. - * @param body Request payload. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GuestAgentInner> beginCreate( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body); + SyncPoller, GuestAgentInner> beginCreate(String resourceUri); /** * Implements GuestAgent PUT method. * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -50,49 +46,30 @@ SyncPoller, GuestAgentInner> beginCreate( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, GuestAgentInner> beginCreate( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body, Context context); + String resourceUri, GuestAgentInner body, Context context); /** * Implements GuestAgent PUT method. * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. - * @param body Request payload. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.SINGLE) - GuestAgentInner create(String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body); + GuestAgentInner create(String resourceUri); /** * Implements GuestAgent PUT method. * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the GuestAgent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GuestAgentInner create(String resourceGroupName, String virtualMachineName, String name); - - /** - * Implements GuestAgent PUT method. - * - *

Create Or Update GuestAgent. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -101,67 +78,61 @@ SyncPoller, GuestAgentInner> beginCreate( * @return defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.SINGLE) - GuestAgentInner create( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body, Context context); + GuestAgentInner create(String resourceUri, GuestAgentInner body, Context context); /** * Gets GuestAgent. * *

Implements GuestAgent GET method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the GuestAgent. + * @return defines the GuestAgent along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - GuestAgentInner get(String resourceGroupName, String virtualMachineName, String name); + Response getWithResponse(String resourceUri, Context context); /** * Gets GuestAgent. * *

Implements GuestAgent GET method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the GuestAgent along with {@link Response}. + * @return defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String virtualMachineName, String name, Context context); + GuestAgentInner get(String resourceUri); /** * Deletes an GuestAgent. * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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> beginDelete(String resourceGroupName, String virtualMachineName, String name); + SyncPoller, Void> beginDelete(String resourceUri); /** * Deletes an GuestAgent. * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @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. @@ -169,62 +140,59 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineName, String name, Context context); + SyncPoller, Void> beginDelete(String resourceUri, Context context); /** * Deletes an GuestAgent. * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 virtualMachineName, String name); + void delete(String resourceUri); /** * Deletes an GuestAgent. * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @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 delete(String resourceGroupName, String virtualMachineName, String name, Context context); + void delete(String resourceUri, Context context); /** * Implements GET GuestAgent in a vm. * *

Returns the list of GuestAgent of the given vm. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 GuestAgent as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVm(String resourceGroupName, String virtualMachineName); + PagedIterable list(String resourceUri); /** * Implements GET GuestAgent in a vm. * *

Returns the list of GuestAgent of the given vm. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @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. @@ -232,5 +200,5 @@ SyncPoller, Void> beginDelete( * @return list of GuestAgent as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVm(String resourceGroupName, String virtualMachineName, Context context); + PagedIterable list(String resourceUri, Context context); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachineInstancesClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachineInstancesClient.java new file mode 100644 index 000000000000..cadb2bde6f23 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachineInstancesClient.java @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.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.connectedvmware.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstanceUpdate; + +/** An instance of this class provides access to all the operations defined in VirtualMachineInstancesClient. */ +public interface VirtualMachineInstancesClient { + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginCreateOrUpdate( + String resourceUri); + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginCreateOrUpdate( + String resourceUri, VirtualMachineInstanceInner body, Context context); + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner createOrUpdate(String resourceUri); + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner createOrUpdate(String resourceUri, VirtualMachineInstanceInner body, Context context); + + /** + * Gets a virtual machine. + * + *

Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 define the virtualMachineInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets a virtual machine. + * + *

Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner get(String resourceUri); + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginUpdate(String resourceUri); + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginUpdate( + String resourceUri, VirtualMachineInstanceUpdate body, Context context); + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner update(String resourceUri); + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner update(String resourceUri, VirtualMachineInstanceUpdate body, Context context); + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDelete(String resourceUri); + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @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> beginDelete( + String resourceUri, Boolean deleteFromHost, Boolean force, Context context); + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceUri); + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @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 delete(String resourceUri, Boolean deleteFromHost, Boolean force, Context context); + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 VirtualMachineInstances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 VirtualMachineInstances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceUri); + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @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 resourceUri, StopVirtualMachineOptions body, Context context); + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceUri); + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @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 resourceUri, StopVirtualMachineOptions body, Context context); + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceUri); + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri, Context context); + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceUri); + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri, Context context); + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceUri); + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri, Context context); + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceUri); + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri, Context context); +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachineTemplatesClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachineTemplatesClient.java index 86c2cede54c7..fab7b728785d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachineTemplatesClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachineTemplatesClient.java @@ -23,7 +23,6 @@ public interface VirtualMachineTemplatesClient { * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -31,7 +30,7 @@ public interface VirtualMachineTemplatesClient { */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualMachineTemplateInner> beginCreate( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body); + String resourceGroupName, String virtualMachineTemplateName); /** * Implements virtual machine template PUT method. @@ -51,23 +50,6 @@ SyncPoller, VirtualMachineTemplateInner> SyncPoller, VirtualMachineTemplateInner> beginCreate( String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body, Context context); - /** - * Implements virtual machine template PUT method. - * - *

Create Or Update virtual machine template. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachineTemplate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineTemplateInner create( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body); - /** * Implements virtual machine template PUT method. * @@ -101,21 +83,6 @@ VirtualMachineTemplateInner create( VirtualMachineTemplateInner create( String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body, Context context); - /** - * Gets a virtual machine template. - * - *

Implements virtual machine template GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachineTemplate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineTemplateInner getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName); - /** * Gets a virtual machine template. * @@ -134,9 +101,9 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String virtualMachineTemplateName, Context context); /** - * Updates a virtual machine template. + * Gets a virtual machine template. * - *

API to update certain properties of the virtual machine template resource. + *

Implements virtual machine template GET method. * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. @@ -146,7 +113,7 @@ Response getByResourceGroupWithResponse( * @return define the virtualMachineTemplate. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineTemplateInner update(String resourceGroupName, String virtualMachineTemplateName); + VirtualMachineTemplateInner getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName); /** * Updates a virtual machine template. @@ -167,21 +134,19 @@ Response updateWithResponse( String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context); /** - * Deletes an virtual machine template. + * Updates a virtual machine template. * - *

Implements virtual machine template DELETE method. + *

API to update certain properties of the virtual machine template resource. * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return define the virtualMachineTemplate. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineTemplateName, Boolean force); + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineTemplateInner update(String resourceGroupName, String virtualMachineTemplateName); /** * Deletes an virtual machine template. @@ -190,16 +155,13 @@ SyncPoller, Void> beginDelete( * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param force Whether force delete was specified. - * @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> beginDelete( - String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineTemplateName); /** * Deletes an virtual machine template. @@ -209,12 +171,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. * @param force Whether force delete was specified. + * @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.SINGLE) - void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context); /** * Deletes an virtual machine template. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachinesClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachinesClient.java deleted file mode 100644 index d6e1894299f7..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualMachinesClient.java +++ /dev/null @@ -1,688 +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.connectedvmware.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.connectedvmware.fluent.models.VirtualMachineAssessPatchesResultInner; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstallPatchesResultInner; -import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstallPatchesParameters; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineUpdate; - -/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ -public interface VirtualMachinesClient { - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineAssessPatchesResultInner> - beginAssessPatches(String resourceGroupName, String name); - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineAssessPatchesResultInner> - beginAssessPatches(String resourceGroupName, String name, Context context); - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineAssessPatchesResultInner assessPatches(String resourceGroupName, String name); - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineAssessPatchesResultInner assessPatches(String resourceGroupName, String name, Context context); - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInstallPatchesResultInner> - beginInstallPatches( - String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput); - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @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 result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInstallPatchesResultInner> - beginInstallPatches( - String resourceGroupName, - String name, - VirtualMachineInstallPatchesParameters installPatchesInput, - Context context); - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInstallPatchesResultInner installPatches( - String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput); - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @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 result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInstallPatchesResultInner installPatches( - String resourceGroupName, - String name, - VirtualMachineInstallPatchesParameters installPatchesInput, - Context context); - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInner> beginCreate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body); - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInner> beginCreate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context); - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner create(String resourceGroupName, String virtualMachineName, VirtualMachineInner body); - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner create(String resourceGroupName, String virtualMachineName); - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner create( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context); - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner getByResourceGroup(String resourceGroupName, String virtualMachineName); - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineName, Context context); - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body); - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context); - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner update(String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body); - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner update(String resourceGroupName, String virtualMachineName); - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner update( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginDelete( - String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @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> beginDelete( - String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain, Context context); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 virtualMachineName, Boolean force, Boolean retain); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineName); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @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 delete(String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain, Context context); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 virtualMachineName, StopVirtualMachineOptions body); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @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 virtualMachineName, StopVirtualMachineOptions body, Context context); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 virtualMachineName, StopVirtualMachineOptions body); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String virtualMachineName); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @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 virtualMachineName, StopVirtualMachineOptions body, Context context); - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String virtualMachineName); - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String virtualMachineName); - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRestart(String resourceGroupName, String virtualMachineName); - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRestart( - String resourceGroupName, String virtualMachineName, Context context); - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String virtualMachineName); - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines in a 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 VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualNetworksClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualNetworksClient.java index 599db62254e9..145de9bcf2f6 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualNetworksClient.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VirtualNetworksClient.java @@ -23,7 +23,6 @@ public interface VirtualNetworksClient { * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -31,7 +30,7 @@ public interface VirtualNetworksClient { */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualNetworkInner> beginCreate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body); + String resourceGroupName, String virtualNetworkName); /** * Implements virtual network PUT method. @@ -51,22 +50,6 @@ SyncPoller, VirtualNetworkInner> beginCreate( SyncPoller, VirtualNetworkInner> beginCreate( String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context); - /** - * Implements virtual network PUT method. - * - *

Create Or Update virtual network. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualNetworkName Name of the virtual network resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualNetwork. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner create(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body); - /** * Implements virtual network PUT method. * @@ -100,21 +83,6 @@ SyncPoller, VirtualNetworkInner> beginCreate( VirtualNetworkInner create( String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context); - /** - * Gets a virtual network. - * - *

Implements virtual network GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualNetworkName Name of the virtual network resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualNetwork. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName); - /** * Gets a virtual network. * @@ -133,9 +101,9 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String virtualNetworkName, Context context); /** - * Updates a virtual network. + * Gets a virtual network. * - *

API to update certain properties of the virtual network resource. + *

Implements virtual network GET method. * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. @@ -145,7 +113,7 @@ Response getByResourceGroupWithResponse( * @return define the virtualNetwork. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner update(String resourceGroupName, String virtualNetworkName); + VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName); /** * Updates a virtual network. @@ -166,20 +134,19 @@ Response updateWithResponse( String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context); /** - * Deletes an virtual network. + * Updates a virtual network. * - *

Implements virtual network DELETE method. + *

API to update certain properties of the virtual network resource. * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return define the virtualNetwork. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName, Boolean force); + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkInner update(String resourceGroupName, String virtualNetworkName); /** * Deletes an virtual network. @@ -188,16 +155,13 @@ Response updateWithResponse( * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. - * @param force Whether force delete was specified. - * @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> beginDelete( - String resourceGroupName, String virtualNetworkName, Boolean force, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName); /** * Deletes an virtual network. @@ -207,12 +171,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. * @param force Whether force delete was specified. + * @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.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName, Boolean force); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, Boolean force, Context context); /** * Deletes an virtual network. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VmInstanceHybridIdentityMetadatasClient.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VmInstanceHybridIdentityMetadatasClient.java new file mode 100644 index 000000000000..fc33ceb1ffc4 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/VmInstanceHybridIdentityMetadatasClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.connectedvmware.fluent.models.VmInstanceHybridIdentityMetadataInner; + +/** + * An instance of this class provides access to all the operations defined in VmInstanceHybridIdentityMetadatasClient. + */ +public interface VmInstanceHybridIdentityMetadatasClient { + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the HybridIdentityMetadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VmInstanceHybridIdentityMetadataInner get(String resourceUri); + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ClusterInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ClusterInner.java index 06c42de97450..1340a3234f22 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ClusterInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ClusterInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -43,6 +44,10 @@ public final class ClusterInner extends Resource { @JsonProperty(value = "kind") private String kind; + /** Creates an instance of ClusterInner class. */ + public ClusterInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -225,7 +230,43 @@ public String customResourceName() { } /** - * Get the datastoreIds property: Gets or sets the datastore ARM ids. + * Get the usedMemoryGB property: Gets the used physical memory on the cluster in GB. + * + * @return the usedMemoryGB value. + */ + public Long usedMemoryGB() { + return this.innerProperties() == null ? null : this.innerProperties().usedMemoryGB(); + } + + /** + * Get the totalMemoryGB property: Gets the total amount of physical memory on the cluster in GB. + * + * @return the totalMemoryGB value. + */ + public Long totalMemoryGB() { + return this.innerProperties() == null ? null : this.innerProperties().totalMemoryGB(); + } + + /** + * Get the usedCpuMHz property: Gets the used CPU usage across all cores on the cluster in MHz. + * + * @return the usedCpuMHz value. + */ + public Long usedCpuMHz() { + return this.innerProperties() == null ? null : this.innerProperties().usedCpuMHz(); + } + + /** + * Get the totalCpuMHz property: Gets the max CPU usage across all cores on the cluster in MHz. + * + * @return the totalCpuMHz value. + */ + public Long totalCpuMHz() { + return this.innerProperties() == null ? null : this.innerProperties().totalCpuMHz(); + } + + /** + * Get the datastoreIds property: Gets the datastore ARM ids. * * @return the datastoreIds value. */ @@ -234,7 +275,7 @@ public List datastoreIds() { } /** - * Get the networkIds property: Gets or sets the network ARM ids. + * Get the networkIds property: Gets the network ARM ids. * * @return the networkIds value. */ @@ -243,11 +284,11 @@ public List networkIds() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ClusterProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ClusterProperties.java index d3ec4ea2fa41..8977c78a5899 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ClusterProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ClusterProperties.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.connectedvmware.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Describes the properties of a Cluster. */ @Fluent public final class ClusterProperties { /* @@ -55,22 +56,50 @@ public final class ClusterProperties { private String customResourceName; /* - * Gets or sets the datastore ARM ids. + * Gets the used physical memory on the cluster in GB. + */ + @JsonProperty(value = "usedMemoryGB", access = JsonProperty.Access.WRITE_ONLY) + private Long usedMemoryGB; + + /* + * Gets the total amount of physical memory on the cluster in GB. + */ + @JsonProperty(value = "totalMemoryGB", access = JsonProperty.Access.WRITE_ONLY) + private Long totalMemoryGB; + + /* + * Gets the used CPU usage across all cores on the cluster in MHz. + */ + @JsonProperty(value = "usedCpuMHz", access = JsonProperty.Access.WRITE_ONLY) + private Long usedCpuMHz; + + /* + * Gets the max CPU usage across all cores on the cluster in MHz. + */ + @JsonProperty(value = "totalCpuMHz", access = JsonProperty.Access.WRITE_ONLY) + private Long totalCpuMHz; + + /* + * Gets the datastore ARM ids. */ @JsonProperty(value = "datastoreIds", access = JsonProperty.Access.WRITE_ONLY) private List datastoreIds; /* - * Gets or sets the network ARM ids. + * Gets the network ARM ids. */ @JsonProperty(value = "networkIds", access = JsonProperty.Access.WRITE_ONLY) private List networkIds; /* - * Gets or sets the provisioning state. + * Gets the provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** Creates an instance of ClusterProperties class. */ + public ClusterProperties() { + } /** * Get the uuid property: Gets or sets a unique identifier for this resource. @@ -169,7 +198,43 @@ public String customResourceName() { } /** - * Get the datastoreIds property: Gets or sets the datastore ARM ids. + * Get the usedMemoryGB property: Gets the used physical memory on the cluster in GB. + * + * @return the usedMemoryGB value. + */ + public Long usedMemoryGB() { + return this.usedMemoryGB; + } + + /** + * Get the totalMemoryGB property: Gets the total amount of physical memory on the cluster in GB. + * + * @return the totalMemoryGB value. + */ + public Long totalMemoryGB() { + return this.totalMemoryGB; + } + + /** + * Get the usedCpuMHz property: Gets the used CPU usage across all cores on the cluster in MHz. + * + * @return the usedCpuMHz value. + */ + public Long usedCpuMHz() { + return this.usedCpuMHz; + } + + /** + * Get the totalCpuMHz property: Gets the max CPU usage across all cores on the cluster in MHz. + * + * @return the totalCpuMHz value. + */ + public Long totalCpuMHz() { + return this.totalCpuMHz; + } + + /** + * Get the datastoreIds property: Gets the datastore ARM ids. * * @return the datastoreIds value. */ @@ -178,7 +243,7 @@ public List datastoreIds() { } /** - * Get the networkIds property: Gets or sets the network ARM ids. + * Get the networkIds property: Gets the network ARM ids. * * @return the networkIds value. */ @@ -187,11 +252,11 @@ public List networkIds() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/DatastoreInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/DatastoreInner.java index 9bfcc2521e02..0c1c584a9bc5 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/DatastoreInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/DatastoreInner.java @@ -44,6 +44,10 @@ public final class DatastoreInner extends Resource { @JsonProperty(value = "kind") private String kind; + /** Creates an instance of DatastoreInner class. */ + public DatastoreInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -225,6 +229,24 @@ public String customResourceName() { return this.innerProperties() == null ? null : this.innerProperties().customResourceName(); } + /** + * Get the capacityGB property: Gets or sets Maximum capacity of this datastore in GBs. + * + * @return the capacityGB value. + */ + public Long capacityGB() { + return this.innerProperties() == null ? null : this.innerProperties().capacityGB(); + } + + /** + * Get the freeSpaceGB property: Gets or sets Available space of this datastore in GBs. + * + * @return the freeSpaceGB value. + */ + public Long freeSpaceGB() { + return this.innerProperties() == null ? null : this.innerProperties().freeSpaceGB(); + } + /** * Get the provisioningState property: Provisioning state of the resource. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/DatastoreProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/DatastoreProperties.java index c002cb2e791e..706197e3ad78 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/DatastoreProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/DatastoreProperties.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Describes the properties of a Datastore. */ @Fluent public final class DatastoreProperties { /* @@ -55,12 +55,28 @@ public final class DatastoreProperties { @JsonProperty(value = "customResourceName", access = JsonProperty.Access.WRITE_ONLY) private String customResourceName; + /* + * Gets or sets Maximum capacity of this datastore in GBs. + */ + @JsonProperty(value = "capacityGB", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityGB; + + /* + * Gets or sets Available space of this datastore in GBs. + */ + @JsonProperty(value = "freeSpaceGB", access = JsonProperty.Access.WRITE_ONLY) + private Long freeSpaceGB; + /* * Provisioning state of the resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; + /** Creates an instance of DatastoreProperties class. */ + public DatastoreProperties() { + } + /** * Get the uuid property: Gets or sets a unique identifier for this resource. * @@ -157,6 +173,24 @@ public String customResourceName() { return this.customResourceName; } + /** + * Get the capacityGB property: Gets or sets Maximum capacity of this datastore in GBs. + * + * @return the capacityGB value. + */ + public Long capacityGB() { + return this.capacityGB; + } + + /** + * Get the freeSpaceGB property: Gets or sets Available space of this datastore in GBs. + * + * @return the freeSpaceGB value. + */ + public Long freeSpaceGB() { + return this.freeSpaceGB; + } + /** * Get the provisioningState property: Provisioning state of the resource. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/GuestAgentInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/GuestAgentInner.java index 3d9b35d9e49a..dd2b17554ee7 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/GuestAgentInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/GuestAgentInner.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.connectedvmware.models.GuestCredential; import com.azure.resourcemanager.connectedvmware.models.HttpProxyConfiguration; import com.azure.resourcemanager.connectedvmware.models.ProvisioningAction; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -25,11 +26,15 @@ public final class GuestAgentInner extends ProxyResource { private GuestAgentProperties innerProperties = new GuestAgentProperties(); /* - * The system data. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of GuestAgentInner class. */ + public GuestAgentInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -40,7 +45,7 @@ private GuestAgentProperties innerProperties() { } /** - * Get the systemData property: The system data. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -80,6 +85,31 @@ public GuestAgentInner withCredentials(GuestCredential credentials) { return this; } + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopeResourceId(); + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the GuestAgentInner object itself. + */ + public GuestAgentInner withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new GuestAgentProperties(); + } + this.innerProperties().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); + return this; + } + /** * Get the httpProxyConfig property: HTTP Proxy configuration for the VM. * @@ -154,11 +184,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/GuestAgentProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/GuestAgentProperties.java index 2198f627b8e1..2214a4c7bc52 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/GuestAgentProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/GuestAgentProperties.java @@ -8,11 +8,12 @@ import com.azure.resourcemanager.connectedvmware.models.GuestCredential; import com.azure.resourcemanager.connectedvmware.models.HttpProxyConfiguration; import com.azure.resourcemanager.connectedvmware.models.ProvisioningAction; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Describes the properties of a Virtual Machine Guest Agent. */ @Fluent public final class GuestAgentProperties { /* @@ -27,6 +28,12 @@ public final class GuestAgentProperties { @JsonProperty(value = "credentials") private GuestCredential credentials; + /* + * The resource id of the private link scope this machine is assigned to, if any. + */ + @JsonProperty(value = "privateLinkScopeResourceId") + private String privateLinkScopeResourceId; + /* * HTTP Proxy configuration for the VM. */ @@ -58,10 +65,14 @@ public final class GuestAgentProperties { private List statuses; /* - * Gets or sets the provisioning state. + * Gets the provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** Creates an instance of GuestAgentProperties class. */ + public GuestAgentProperties() { + } /** * Get the uuid property: Gets or sets a unique identifier for this resource. @@ -92,6 +103,28 @@ public GuestAgentProperties withCredentials(GuestCredential credentials) { return this; } + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.privateLinkScopeResourceId; + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the GuestAgentProperties object itself. + */ + public GuestAgentProperties withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + this.privateLinkScopeResourceId = privateLinkScopeResourceId; + return this; + } + /** * Get the httpProxyConfig property: HTTP Proxy configuration for the VM. * @@ -160,11 +193,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HostModelInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HostModelInner.java index b2ccf389f940..358216a3b2f5 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HostModelInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HostModelInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -43,6 +44,10 @@ public final class HostModelInner extends Resource { @JsonProperty(value = "kind") private String kind; + /** Creates an instance of HostModelInner class. */ + public HostModelInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -225,11 +230,65 @@ public String customResourceName() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the overallMemoryUsageGB property: Gets the used physical memory on the host in GB. + * + * @return the overallMemoryUsageGB value. + */ + public Long overallMemoryUsageGB() { + return this.innerProperties() == null ? null : this.innerProperties().overallMemoryUsageGB(); + } + + /** + * Get the memorySizeGB property: Gets the total amount of physical memory on the host in GB. + * + * @return the memorySizeGB value. + */ + public Long memorySizeGB() { + return this.innerProperties() == null ? null : this.innerProperties().memorySizeGB(); + } + + /** + * Get the overallCpuUsageMHz property: Gets the used CPU usage across all cores in MHz. + * + * @return the overallCpuUsageMHz value. + */ + public Long overallCpuUsageMHz() { + return this.innerProperties() == null ? null : this.innerProperties().overallCpuUsageMHz(); + } + + /** + * Get the cpuMhz property: Gets the max CPU usage across all cores in MHz. + * + * @return the cpuMhz value. + */ + public Long cpuMhz() { + return this.innerProperties() == null ? null : this.innerProperties().cpuMhz(); + } + + /** + * Get the datastoreIds property: Gets the datastore ARM ids. + * + * @return the datastoreIds value. + */ + public List datastoreIds() { + return this.innerProperties() == null ? null : this.innerProperties().datastoreIds(); + } + + /** + * Get the networkIds property: Gets the network ARM ids. + * + * @return the networkIds value. + */ + public List networkIds() { + return this.innerProperties() == null ? null : this.innerProperties().networkIds(); + } + + /** + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HostProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HostProperties.java index 0303d8121496..c6daccbfe92b 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HostProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HostProperties.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.connectedvmware.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Describes the properties of a Host. */ @Fluent public final class HostProperties { /* @@ -55,10 +56,50 @@ public final class HostProperties { private String customResourceName; /* - * Gets or sets the provisioning state. + * Gets the used physical memory on the host in GB. + */ + @JsonProperty(value = "overallMemoryUsageGB", access = JsonProperty.Access.WRITE_ONLY) + private Long overallMemoryUsageGB; + + /* + * Gets the total amount of physical memory on the host in GB. + */ + @JsonProperty(value = "memorySizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Long memorySizeGB; + + /* + * Gets the used CPU usage across all cores in MHz. + */ + @JsonProperty(value = "overallCpuUsageMHz", access = JsonProperty.Access.WRITE_ONLY) + private Long overallCpuUsageMHz; + + /* + * Gets the max CPU usage across all cores in MHz. + */ + @JsonProperty(value = "cpuMhz", access = JsonProperty.Access.WRITE_ONLY) + private Long cpuMhz; + + /* + * Gets the datastore ARM ids. + */ + @JsonProperty(value = "datastoreIds", access = JsonProperty.Access.WRITE_ONLY) + private List datastoreIds; + + /* + * Gets the network ARM ids. + */ + @JsonProperty(value = "networkIds", access = JsonProperty.Access.WRITE_ONLY) + private List networkIds; + + /* + * Gets the provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** Creates an instance of HostProperties class. */ + public HostProperties() { + } /** * Get the uuid property: Gets or sets a unique identifier for this resource. @@ -157,11 +198,65 @@ public String customResourceName() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the overallMemoryUsageGB property: Gets the used physical memory on the host in GB. + * + * @return the overallMemoryUsageGB value. + */ + public Long overallMemoryUsageGB() { + return this.overallMemoryUsageGB; + } + + /** + * Get the memorySizeGB property: Gets the total amount of physical memory on the host in GB. + * + * @return the memorySizeGB value. + */ + public Long memorySizeGB() { + return this.memorySizeGB; + } + + /** + * Get the overallCpuUsageMHz property: Gets the used CPU usage across all cores in MHz. + * + * @return the overallCpuUsageMHz value. + */ + public Long overallCpuUsageMHz() { + return this.overallCpuUsageMHz; + } + + /** + * Get the cpuMhz property: Gets the max CPU usage across all cores in MHz. + * + * @return the cpuMhz value. + */ + public Long cpuMhz() { + return this.cpuMhz; + } + + /** + * Get the datastoreIds property: Gets the datastore ARM ids. + * + * @return the datastoreIds value. + */ + public List datastoreIds() { + return this.datastoreIds; + } + + /** + * Get the networkIds property: Gets the network ARM ids. + * + * @return the networkIds value. + */ + public List networkIds() { + return this.networkIds; + } + + /** + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HybridIdentityMetadataProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HybridIdentityMetadataProperties.java deleted file mode 100644 index cc1501d8c867..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HybridIdentityMetadataProperties.java +++ /dev/null @@ -1,106 +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.connectedvmware.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.models.Identity; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines the resource properties. */ -@Fluent -public final class HybridIdentityMetadataProperties { - /* - * Gets or sets the Vm Id. - */ - @JsonProperty(value = "vmId") - private String vmId; - - /* - * Gets or sets the Public Key. - */ - @JsonProperty(value = "publicKey") - private String publicKey; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) - private Identity identity; - - /* - * Gets or sets the provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the vmId property: Gets or sets the Vm Id. - * - * @return the vmId value. - */ - public String vmId() { - return this.vmId; - } - - /** - * Set the vmId property: Gets or sets the Vm Id. - * - * @param vmId the vmId value to set. - * @return the HybridIdentityMetadataProperties object itself. - */ - public HybridIdentityMetadataProperties withVmId(String vmId) { - this.vmId = vmId; - return this; - } - - /** - * Get the publicKey property: Gets or sets the Public Key. - * - * @return the publicKey value. - */ - public String publicKey() { - return this.publicKey; - } - - /** - * Set the publicKey property: Gets or sets the Public Key. - * - * @param publicKey the publicKey value to set. - * @return the HybridIdentityMetadataProperties object itself. - */ - public HybridIdentityMetadataProperties withPublicKey(String publicKey) { - this.publicKey = publicKey; - return this; - } - - /** - * Get the identity property: The identity of the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/InventoryItemInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/InventoryItemInner.java index 40785deb9889..c9c9874a3cc3 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/InventoryItemInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/InventoryItemInner.java @@ -8,6 +8,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.connectedvmware.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** Defines the inventory item. */ @@ -17,13 +18,7 @@ public final class InventoryItemInner extends ProxyResource { * Resource properties. */ @JsonProperty(value = "properties", required = true) - private InventoryItemProperties innerProperties = new InventoryItemProperties(); - - /* - * The system data. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; + private InventoryItemProperties properties; /* * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. @@ -33,22 +28,34 @@ public final class InventoryItemInner extends ProxyResource { @JsonProperty(value = "kind") private String kind; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of InventoryItemInner class. */ + public InventoryItemInner() { + } + /** - * Get the innerProperties property: Resource properties. + * Get the properties property: Resource properties. * - * @return the innerProperties value. + * @return the properties value. */ - private InventoryItemProperties innerProperties() { - return this.innerProperties; + public InventoryItemProperties properties() { + return this.properties; } /** - * Get the systemData property: The system data. + * Set the properties property: Resource properties. * - * @return the systemData value. + * @param properties the properties value to set. + * @return the InventoryItemInner object itself. */ - public SystemData systemData() { - return this.systemData; + public InventoryItemInner withProperties(InventoryItemProperties properties) { + this.properties = properties; + return this; } /** @@ -76,81 +83,12 @@ public InventoryItemInner withKind(String kind) { } /** - * Get the managedResourceId property: Gets or sets the tracked resource id corresponding to the inventory resource. - * - * @return the managedResourceId value. - */ - public String managedResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().managedResourceId(); - } - - /** - * Set the managedResourceId property: Gets or sets the tracked resource id corresponding to the inventory resource. - * - * @param managedResourceId the managedResourceId value to set. - * @return the InventoryItemInner object itself. - */ - public InventoryItemInner withManagedResourceId(String managedResourceId) { - if (this.innerProperties() == null) { - this.innerProperties = new InventoryItemProperties(); - } - this.innerProperties().withManagedResourceId(managedResourceId); - return this; - } - - /** - * Get the moRefId property: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the moRefId value. - */ - public String moRefId() { - return this.innerProperties() == null ? null : this.innerProperties().moRefId(); - } - - /** - * Set the moRefId property: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. - * - * @param moRefId the moRefId value to set. - * @return the InventoryItemInner object itself. - */ - public InventoryItemInner withMoRefId(String moRefId) { - if (this.innerProperties() == null) { - this.innerProperties = new InventoryItemProperties(); - } - this.innerProperties().withMoRefId(moRefId); - return this; - } - - /** - * Get the moName property: Gets or sets the vCenter Managed Object name for the inventory item. - * - * @return the moName value. - */ - public String moName() { - return this.innerProperties() == null ? null : this.innerProperties().moName(); - } - - /** - * Set the moName property: Gets or sets the vCenter Managed Object name for the inventory item. - * - * @param moName the moName value to set. - * @return the InventoryItemInner object itself. - */ - public InventoryItemInner withMoName(String moName) { - if (this.innerProperties() == null) { - this.innerProperties = new InventoryItemProperties(); - } - this.innerProperties().withMoName(moName); - return this; - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. + * @return the systemData value. */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public SystemData systemData() { + return this.systemData; } /** @@ -159,13 +97,12 @@ public String provisioningState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() == null) { + if (properties() == null) { throw LOGGER .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model InventoryItemInner")); + new IllegalArgumentException("Missing required property properties in model InventoryItemInner")); } else { - innerProperties().validate(); + properties().validate(); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/MachineExtensionInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/MachineExtensionInner.java deleted file mode 100644 index e6cdcbfc0d65..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/MachineExtensionInner.java +++ /dev/null @@ -1,297 +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.connectedvmware.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.connectedvmware.models.MachineExtensionPropertiesInstanceView; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes a Machine Extension. */ -@Fluent -public final class MachineExtensionInner extends Resource { - /* - * Describes Machine Extension Properties. - */ - @JsonProperty(value = "properties") - private MachineExtensionProperties innerProperties; - - /* - * The system data. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** - * Get the innerProperties property: Describes Machine Extension Properties. - * - * @return the innerProperties value. - */ - private MachineExtensionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system data. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** {@inheritDoc} */ - @Override - public MachineExtensionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public MachineExtensionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withForceUpdateTag(String forceUpdateTag) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionProperties(); - } - this.innerProperties().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String typePropertiesType() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withTypePropertiesType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionProperties(); - } - this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionProperties(); - } - this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionProperties(); - } - this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withSettings(Object settings) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withProtectedSettings(Object protectedSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionProperties(); - } - this.innerProperties().withProtectedSettings(protectedSettings); - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the instanceView property: The machine extension instance view. - * - * @return the instanceView value. - */ - public MachineExtensionPropertiesInstanceView instanceView() { - return this.innerProperties() == null ? null : this.innerProperties().instanceView(); - } - - /** - * Set the instanceView property: The machine extension instance view. - * - * @param instanceView the instanceView value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withInstanceView(MachineExtensionPropertiesInstanceView instanceView) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionProperties(); - } - this.innerProperties().withInstanceView(instanceView); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/MachineExtensionProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/MachineExtensionProperties.java deleted file mode 100644 index fb8a231d08ef..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/MachineExtensionProperties.java +++ /dev/null @@ -1,287 +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.connectedvmware.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.models.MachineExtensionPropertiesInstanceView; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Machine Extension. */ -@Fluent -public final class MachineExtensionProperties { - /* - * How the extension handler should be forced to update even if the extension configuration has not changed. - */ - @JsonProperty(value = "forceUpdateTag") - private String forceUpdateTag; - - /* - * The name of the extension handler publisher. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * Specifies the type of the extension; an example is "CustomScriptExtension". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Specifies the version of the script handler. - */ - @JsonProperty(value = "typeHandlerVersion") - private String typeHandlerVersion; - - /* - * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version - * available. - */ - @JsonProperty(value = "enableAutomaticUpgrade") - private Boolean enableAutomaticUpgrade; - - /* - * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once - * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set - * to true. - */ - @JsonProperty(value = "autoUpgradeMinorVersion") - private Boolean autoUpgradeMinorVersion; - - /* - * Json formatted public settings for the extension. - */ - @JsonProperty(value = "settings") - private Object settings; - - /* - * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at - * all. - */ - @JsonProperty(value = "protectedSettings") - private Object protectedSettings; - - /* - * The provisioning state, which only appears in the response. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The machine extension instance view. - */ - @JsonProperty(value = "instanceView") - private MachineExtensionPropertiesInstanceView instanceView; - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.forceUpdateTag; - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the MachineExtensionProperties object itself. - */ - public MachineExtensionProperties withForceUpdateTag(String forceUpdateTag) { - this.forceUpdateTag = forceUpdateTag; - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the MachineExtensionProperties object itself. - */ - public MachineExtensionProperties withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the MachineExtensionProperties object itself. - */ - public MachineExtensionProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the MachineExtensionProperties object itself. - */ - public MachineExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { - this.typeHandlerVersion = typeHandlerVersion; - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.enableAutomaticUpgrade; - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the MachineExtensionProperties object itself. - */ - public MachineExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - this.enableAutomaticUpgrade = enableAutomaticUpgrade; - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.autoUpgradeMinorVersion; - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the MachineExtensionProperties object itself. - */ - public MachineExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.settings; - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the MachineExtensionProperties object itself. - */ - public MachineExtensionProperties withSettings(Object settings) { - this.settings = settings; - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.protectedSettings; - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the MachineExtensionProperties object itself. - */ - public MachineExtensionProperties withProtectedSettings(Object protectedSettings) { - this.protectedSettings = protectedSettings; - return this; - } - - /** - * Get the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the instanceView property: The machine extension instance view. - * - * @return the instanceView value. - */ - public MachineExtensionPropertiesInstanceView instanceView() { - return this.instanceView; - } - - /** - * Set the instanceView property: The machine extension instance view. - * - * @param instanceView the instanceView value to set. - * @return the MachineExtensionProperties object itself. - */ - public MachineExtensionProperties withInstanceView(MachineExtensionPropertiesInstanceView instanceView) { - this.instanceView = instanceView; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (instanceView() != null) { - instanceView().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/MachineExtensionUpdateProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/MachineExtensionUpdateProperties.java deleted file mode 100644 index 246ff830783e..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/MachineExtensionUpdateProperties.java +++ /dev/null @@ -1,242 +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.connectedvmware.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the properties of a Machine Extension. */ -@Fluent -public final class MachineExtensionUpdateProperties { - /* - * How the extension handler should be forced to update even if the extension configuration has not changed. - */ - @JsonProperty(value = "forceUpdateTag") - private String forceUpdateTag; - - /* - * The name of the extension handler publisher. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * Specifies the type of the extension; an example is "CustomScriptExtension". - */ - @JsonProperty(value = "type") - private String type; - - /* - * Specifies the version of the script handler. - */ - @JsonProperty(value = "typeHandlerVersion") - private String typeHandlerVersion; - - /* - * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version - * available. - */ - @JsonProperty(value = "enableAutomaticUpgrade") - private Boolean enableAutomaticUpgrade; - - /* - * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once - * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set - * to true. - */ - @JsonProperty(value = "autoUpgradeMinorVersion") - private Boolean autoUpgradeMinorVersion; - - /* - * Json formatted public settings for the extension. - */ - @JsonProperty(value = "settings") - private Object settings; - - /* - * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at - * all. - */ - @JsonProperty(value = "protectedSettings") - private Object protectedSettings; - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.forceUpdateTag; - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the MachineExtensionUpdateProperties object itself. - */ - public MachineExtensionUpdateProperties withForceUpdateTag(String forceUpdateTag) { - this.forceUpdateTag = forceUpdateTag; - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the MachineExtensionUpdateProperties object itself. - */ - public MachineExtensionUpdateProperties withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the MachineExtensionUpdateProperties object itself. - */ - public MachineExtensionUpdateProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the MachineExtensionUpdateProperties object itself. - */ - public MachineExtensionUpdateProperties withTypeHandlerVersion(String typeHandlerVersion) { - this.typeHandlerVersion = typeHandlerVersion; - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.enableAutomaticUpgrade; - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the MachineExtensionUpdateProperties object itself. - */ - public MachineExtensionUpdateProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - this.enableAutomaticUpgrade = enableAutomaticUpgrade; - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.autoUpgradeMinorVersion; - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the MachineExtensionUpdateProperties object itself. - */ - public MachineExtensionUpdateProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.settings; - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the MachineExtensionUpdateProperties object itself. - */ - public MachineExtensionUpdateProperties withSettings(Object settings) { - this.settings = settings; - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.protectedSettings; - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the MachineExtensionUpdateProperties object itself. - */ - public MachineExtensionUpdateProperties withProtectedSettings(Object protectedSettings) { - this.protectedSettings = protectedSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/OperationInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/OperationInner.java index ee3f0e2122d2..2cd918be0c9b 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/OperationInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/OperationInner.java @@ -29,6 +29,10 @@ public final class OperationInner { @JsonProperty(value = "display") private OperationDisplay display; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: Name of the operation. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/PatchSettings.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/PatchSettings.java deleted file mode 100644 index b9ec8e0a4df9..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/PatchSettings.java +++ /dev/null @@ -1,72 +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.connectedvmware.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the patch settings. */ -@Fluent -public final class PatchSettings { - /* - * Specifies the assessment mode. - */ - @JsonProperty(value = "assessmentMode") - private String assessmentMode; - - /* - * Specifies the patch mode. - */ - @JsonProperty(value = "patchMode") - private String patchMode; - - /** - * Get the assessmentMode property: Specifies the assessment mode. - * - * @return the assessmentMode value. - */ - public String assessmentMode() { - return this.assessmentMode; - } - - /** - * Set the assessmentMode property: Specifies the assessment mode. - * - * @param assessmentMode the assessmentMode value to set. - * @return the PatchSettings object itself. - */ - public PatchSettings withAssessmentMode(String assessmentMode) { - this.assessmentMode = assessmentMode; - return this; - } - - /** - * Get the patchMode property: Specifies the patch mode. - * - * @return the patchMode value. - */ - public String patchMode() { - return this.patchMode; - } - - /** - * Set the patchMode property: Specifies the patch mode. - * - * @param patchMode the patchMode value to set. - * @return the PatchSettings object itself. - */ - public PatchSettings withPatchMode(String patchMode) { - this.patchMode = patchMode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ResourcePoolInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ResourcePoolInner.java index 22b5fdbc6e3d..62dd1689d010 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ResourcePoolInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ResourcePoolInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -43,6 +44,10 @@ public final class ResourcePoolInner extends Resource { @JsonProperty(value = "kind") private String kind; + /** Creates an instance of ResourcePoolInner class. */ + public ResourcePoolInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -266,6 +271,42 @@ public Long memLimitMB() { return this.innerProperties() == null ? null : this.innerProperties().memLimitMB(); } + /** + * Get the memOverallUsageGB property: Gets the used physical memory on the pool in GB. + * + * @return the memOverallUsageGB value. + */ + public Long memOverallUsageGB() { + return this.innerProperties() == null ? null : this.innerProperties().memOverallUsageGB(); + } + + /** + * Get the memCapacityGB property: Gets the total amount of physical memory on the pool in GB. + * + * @return the memCapacityGB value. + */ + public Long memCapacityGB() { + return this.innerProperties() == null ? null : this.innerProperties().memCapacityGB(); + } + + /** + * Get the cpuOverallUsageMHz property: Gets the used CPU usage across all cores on the pool in MHz. + * + * @return the cpuOverallUsageMHz value. + */ + public Long cpuOverallUsageMHz() { + return this.innerProperties() == null ? null : this.innerProperties().cpuOverallUsageMHz(); + } + + /** + * Get the cpuCapacityMHz property: Gets the max CPU usage across all cores on the pool in MHz. + * + * @return the cpuCapacityMHz value. + */ + public Long cpuCapacityMHz() { + return this.innerProperties() == null ? null : this.innerProperties().cpuCapacityMHz(); + } + /** * Get the customResourceName property: Gets the name of the corresponding resource in Kubernetes. * @@ -275,6 +316,24 @@ public String customResourceName() { return this.innerProperties() == null ? null : this.innerProperties().customResourceName(); } + /** + * Get the datastoreIds property: Gets the datastore ARM ids. + * + * @return the datastoreIds value. + */ + public List datastoreIds() { + return this.innerProperties() == null ? null : this.innerProperties().datastoreIds(); + } + + /** + * Get the networkIds property: Gets the network ARM ids. + * + * @return the networkIds value. + */ + public List networkIds() { + return this.innerProperties() == null ? null : this.innerProperties().networkIds(); + } + /** * Get the statuses property: The resource status information. * @@ -285,11 +344,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ResourcePoolProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ResourcePoolProperties.java index 76a667ecd525..5f3e81e99091 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ResourcePoolProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/ResourcePoolProperties.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.connectedvmware.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Describes the properties of a Resource Pool. */ @Fluent public final class ResourcePoolProperties { /* @@ -84,12 +85,48 @@ public final class ResourcePoolProperties { @JsonProperty(value = "memLimitMB", access = JsonProperty.Access.WRITE_ONLY) private Long memLimitMB; + /* + * Gets the used physical memory on the pool in GB. + */ + @JsonProperty(value = "memOverallUsageGB", access = JsonProperty.Access.WRITE_ONLY) + private Long memOverallUsageGB; + + /* + * Gets the total amount of physical memory on the pool in GB. + */ + @JsonProperty(value = "memCapacityGB", access = JsonProperty.Access.WRITE_ONLY) + private Long memCapacityGB; + + /* + * Gets the used CPU usage across all cores on the pool in MHz. + */ + @JsonProperty(value = "cpuOverallUsageMHz", access = JsonProperty.Access.WRITE_ONLY) + private Long cpuOverallUsageMHz; + + /* + * Gets the max CPU usage across all cores on the pool in MHz. + */ + @JsonProperty(value = "cpuCapacityMHz", access = JsonProperty.Access.WRITE_ONLY) + private Long cpuCapacityMHz; + /* * Gets the name of the corresponding resource in Kubernetes. */ @JsonProperty(value = "customResourceName", access = JsonProperty.Access.WRITE_ONLY) private String customResourceName; + /* + * Gets the datastore ARM ids. + */ + @JsonProperty(value = "datastoreIds", access = JsonProperty.Access.WRITE_ONLY) + private List datastoreIds; + + /* + * Gets the network ARM ids. + */ + @JsonProperty(value = "networkIds", access = JsonProperty.Access.WRITE_ONLY) + private List networkIds; + /* * The resource status information. */ @@ -97,10 +134,14 @@ public final class ResourcePoolProperties { private List statuses; /* - * Gets or sets the provisioning state. + * Gets the provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** Creates an instance of ResourcePoolProperties class. */ + public ResourcePoolProperties() { + } /** * Get the uuid property: Gets or sets a unique identifier for this resource. @@ -240,6 +281,42 @@ public Long memLimitMB() { return this.memLimitMB; } + /** + * Get the memOverallUsageGB property: Gets the used physical memory on the pool in GB. + * + * @return the memOverallUsageGB value. + */ + public Long memOverallUsageGB() { + return this.memOverallUsageGB; + } + + /** + * Get the memCapacityGB property: Gets the total amount of physical memory on the pool in GB. + * + * @return the memCapacityGB value. + */ + public Long memCapacityGB() { + return this.memCapacityGB; + } + + /** + * Get the cpuOverallUsageMHz property: Gets the used CPU usage across all cores on the pool in MHz. + * + * @return the cpuOverallUsageMHz value. + */ + public Long cpuOverallUsageMHz() { + return this.cpuOverallUsageMHz; + } + + /** + * Get the cpuCapacityMHz property: Gets the max CPU usage across all cores on the pool in MHz. + * + * @return the cpuCapacityMHz value. + */ + public Long cpuCapacityMHz() { + return this.cpuCapacityMHz; + } + /** * Get the customResourceName property: Gets the name of the corresponding resource in Kubernetes. * @@ -249,6 +326,24 @@ public String customResourceName() { return this.customResourceName; } + /** + * Get the datastoreIds property: Gets the datastore ARM ids. + * + * @return the datastoreIds value. + */ + public List datastoreIds() { + return this.datastoreIds; + } + + /** + * Get the networkIds property: Gets the network ARM ids. + * + * @return the networkIds value. + */ + public List networkIds() { + return this.networkIds; + } + /** * Get the statuses property: The resource status information. * @@ -259,11 +354,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VCenterInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VCenterInner.java index 7dcc1beb345b..d5c24bd90c37 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VCenterInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VCenterInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.azure.resourcemanager.connectedvmware.models.VICredential; import com.fasterxml.jackson.annotation.JsonProperty; @@ -44,6 +45,10 @@ public final class VCenterInner extends Resource { @JsonProperty(value = "kind") private String kind; + /** Creates an instance of VCenterInner class. */ + public VCenterInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -244,11 +249,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VCenterProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VCenterProperties.java index 0415fd32a32e..03517878e92d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VCenterProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VCenterProperties.java @@ -6,12 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.azure.resourcemanager.connectedvmware.models.VICredential; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Describes the properties of a VCenter. */ @Fluent public final class VCenterProperties { /* @@ -69,10 +70,14 @@ public final class VCenterProperties { private List statuses; /* - * Gets or sets the provisioning state. + * Gets the provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** Creates an instance of VCenterProperties class. */ + public VCenterProperties() { + } /** * Get the uuid property: Gets or sets a unique identifier for this resource. @@ -189,11 +194,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineAssessPatchesResultInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineAssessPatchesResultInner.java deleted file mode 100644 index 307c6fe9a704..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineAssessPatchesResultInner.java +++ /dev/null @@ -1,207 +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.connectedvmware.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.models.AvailablePatchCountByClassification; -import com.azure.resourcemanager.connectedvmware.models.ErrorDetail; -import com.azure.resourcemanager.connectedvmware.models.OsTypeUM; -import com.azure.resourcemanager.connectedvmware.models.PatchOperationStartedBy; -import com.azure.resourcemanager.connectedvmware.models.PatchOperationStatus; -import com.azure.resourcemanager.connectedvmware.models.PatchServiceUsed; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes the properties of an AssessPatches result. */ -@Fluent -public final class VirtualMachineAssessPatchesResultInner { - /* - * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - * At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private PatchOperationStatus status; - - /* - * The activity ID of the operation that produced this result. - */ - @JsonProperty(value = "assessmentActivityId", access = JsonProperty.Access.WRITE_ONLY) - private String assessmentActivityId; - - /* - * The overall reboot status of the VM. It will be true when partially installed patches require a reboot to - * complete installation but the reboot has not yet occurred. - */ - @JsonProperty(value = "rebootPending", access = JsonProperty.Access.WRITE_ONLY) - private Boolean rebootPending; - - /* - * Summarization of patches available for installation on the machine by classification. - */ - @JsonProperty(value = "availablePatchCountByClassification") - private AvailablePatchCountByClassification availablePatchCountByClassification; - - /* - * The UTC timestamp when the operation began. - */ - @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startDateTime; - - /* - * The UTC timestamp when the operation finished. - */ - @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedDateTime; - - /* - * Indicates if operation was triggered by user or by platform. - */ - @JsonProperty(value = "startedBy", access = JsonProperty.Access.WRITE_ONLY) - private PatchOperationStartedBy startedBy; - - /* - * Specifies the patch service used for the operation. - */ - @JsonProperty(value = "patchServiceUsed", access = JsonProperty.Access.WRITE_ONLY) - private PatchServiceUsed patchServiceUsed; - - /* - * The operating system type of the machine. - */ - @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) - private OsTypeUM osType; - - /* - * Error details. - * - * The errors that were encountered during execution of the operation. The details array contains the list of them. - */ - @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) - private ErrorDetail errorDetails; - - /** - * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until - * the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or - * "CompletedWithWarnings.". - * - * @return the status value. - */ - public PatchOperationStatus status() { - return this.status; - } - - /** - * Get the assessmentActivityId property: The activity ID of the operation that produced this result. - * - * @return the assessmentActivityId value. - */ - public String assessmentActivityId() { - return this.assessmentActivityId; - } - - /** - * Get the rebootPending property: The overall reboot status of the VM. It will be true when partially installed - * patches require a reboot to complete installation but the reboot has not yet occurred. - * - * @return the rebootPending value. - */ - public Boolean rebootPending() { - return this.rebootPending; - } - - /** - * Get the availablePatchCountByClassification property: Summarization of patches available for installation on the - * machine by classification. - * - * @return the availablePatchCountByClassification value. - */ - public AvailablePatchCountByClassification availablePatchCountByClassification() { - return this.availablePatchCountByClassification; - } - - /** - * Set the availablePatchCountByClassification property: Summarization of patches available for installation on the - * machine by classification. - * - * @param availablePatchCountByClassification the availablePatchCountByClassification value to set. - * @return the VirtualMachineAssessPatchesResultInner object itself. - */ - public VirtualMachineAssessPatchesResultInner withAvailablePatchCountByClassification( - AvailablePatchCountByClassification availablePatchCountByClassification) { - this.availablePatchCountByClassification = availablePatchCountByClassification; - return this; - } - - /** - * Get the startDateTime property: The UTC timestamp when the operation began. - * - * @return the startDateTime value. - */ - public OffsetDateTime startDateTime() { - return this.startDateTime; - } - - /** - * Get the lastModifiedDateTime property: The UTC timestamp when the operation finished. - * - * @return the lastModifiedDateTime value. - */ - public OffsetDateTime lastModifiedDateTime() { - return this.lastModifiedDateTime; - } - - /** - * Get the startedBy property: Indicates if operation was triggered by user or by platform. - * - * @return the startedBy value. - */ - public PatchOperationStartedBy startedBy() { - return this.startedBy; - } - - /** - * Get the patchServiceUsed property: Specifies the patch service used for the operation. - * - * @return the patchServiceUsed value. - */ - public PatchServiceUsed patchServiceUsed() { - return this.patchServiceUsed; - } - - /** - * Get the osType property: The operating system type of the machine. - * - * @return the osType value. - */ - public OsTypeUM osType() { - return this.osType; - } - - /** - * Get the errorDetails property: Error details. - * - *

The errors that were encountered during execution of the operation. The details array contains the list of - * them. - * - * @return the errorDetails value. - */ - public ErrorDetail errorDetails() { - return this.errorDetails; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (availablePatchCountByClassification() != null) { - availablePatchCountByClassification().validate(); - } - if (errorDetails() != null) { - errorDetails().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInner.java deleted file mode 100644 index f349fa1fdf00..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInner.java +++ /dev/null @@ -1,585 +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.connectedvmware.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; -import com.azure.resourcemanager.connectedvmware.models.FirmwareType; -import com.azure.resourcemanager.connectedvmware.models.GuestAgentProfile; -import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; -import com.azure.resourcemanager.connectedvmware.models.Identity; -import com.azure.resourcemanager.connectedvmware.models.NetworkProfile; -import com.azure.resourcemanager.connectedvmware.models.OsProfile; -import com.azure.resourcemanager.connectedvmware.models.PlacementProfile; -import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; -import com.azure.resourcemanager.connectedvmware.models.SecurityProfile; -import com.azure.resourcemanager.connectedvmware.models.StorageProfile; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Define the virtualMachine. */ -@Fluent -public final class VirtualMachineInner extends Resource { - /* - * Resource properties. - */ - @JsonProperty(value = "properties", required = true) - private VirtualMachineProperties innerProperties = new VirtualMachineProperties(); - - /* - * Gets or sets the extended location. - */ - @JsonProperty(value = "extendedLocation") - private ExtendedLocation extendedLocation; - - /* - * The system data. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. - * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist - * this value. - */ - @JsonProperty(value = "kind") - private String kind; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity") - private Identity identity; - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private VirtualMachineProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the extendedLocation property: Gets or sets the extended location. - * - * @return the extendedLocation value. - */ - public ExtendedLocation extendedLocation() { - return this.extendedLocation; - } - - /** - * Set the extendedLocation property: Gets or sets the extended location. - * - * @param extendedLocation the extendedLocation value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withExtendedLocation(ExtendedLocation extendedLocation) { - this.extendedLocation = extendedLocation; - return this; - } - - /** - * Get the systemData property: The system data. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must - * validate and persist this value. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must - * validate and persist this value. - * - * @param kind the kind value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the identity property: The identity of the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the resource. - * - * @param identity the identity value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the resourcePoolId property: Gets or sets the ARM Id of the resourcePool resource on which this virtual - * machine will deploy. - * - * @return the resourcePoolId value. - */ - public String resourcePoolId() { - return this.innerProperties() == null ? null : this.innerProperties().resourcePoolId(); - } - - /** - * Set the resourcePoolId property: Gets or sets the ARM Id of the resourcePool resource on which this virtual - * machine will deploy. - * - * @param resourcePoolId the resourcePoolId value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withResourcePoolId(String resourcePoolId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withResourcePoolId(resourcePoolId); - return this; - } - - /** - * Get the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual machine. - * - * @return the templateId value. - */ - public String templateId() { - return this.innerProperties() == null ? null : this.innerProperties().templateId(); - } - - /** - * Set the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual machine. - * - * @param templateId the templateId value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withTemplateId(String templateId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withTemplateId(templateId); - return this; - } - - /** - * Get the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. - * - * @return the vCenterId value. - */ - public String vCenterId() { - return this.innerProperties() == null ? null : this.innerProperties().vCenterId(); - } - - /** - * Set the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. - * - * @param vCenterId the vCenterId value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withVCenterId(String vCenterId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withVCenterId(vCenterId); - return this; - } - - /** - * Get the placementProfile property: Placement properties. - * - * @return the placementProfile value. - */ - public PlacementProfile placementProfile() { - return this.innerProperties() == null ? null : this.innerProperties().placementProfile(); - } - - /** - * Set the placementProfile property: Placement properties. - * - * @param placementProfile the placementProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withPlacementProfile(PlacementProfile placementProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withPlacementProfile(placementProfile); - return this; - } - - /** - * Get the osProfile property: OS properties. - * - * @return the osProfile value. - */ - public OsProfile osProfile() { - return this.innerProperties() == null ? null : this.innerProperties().osProfile(); - } - - /** - * Set the osProfile property: OS properties. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withOsProfile(OsProfile osProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withOsProfile(osProfile); - return this; - } - - /** - * Get the hardwareProfile property: Hardware properties. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); - } - - /** - * Set the hardwareProfile property: Hardware properties. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withHardwareProfile(HardwareProfile hardwareProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withHardwareProfile(hardwareProfile); - return this; - } - - /** - * Get the networkProfile property: Network properties. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: Network properties. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withNetworkProfile(NetworkProfile networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Get the storageProfile property: Storage properties. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: Storage properties. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withStorageProfile(StorageProfile storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the guestAgentProfile property: Guest agent status properties. - * - * @return the guestAgentProfile value. - */ - public GuestAgentProfile guestAgentProfile() { - return this.innerProperties() == null ? null : this.innerProperties().guestAgentProfile(); - } - - /** - * Set the guestAgentProfile property: Guest agent status properties. - * - * @param guestAgentProfile the guestAgentProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withGuestAgentProfile(GuestAgentProfile guestAgentProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withGuestAgentProfile(guestAgentProfile); - return this; - } - - /** - * Get the securityProfile property: Gets the security profile. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); - } - - /** - * Set the securityProfile property: Gets the security profile. - * - * @param securityProfile the securityProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withSecurityProfile(SecurityProfile securityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withSecurityProfile(securityProfile); - return this; - } - - /** - * Get the moRefId property: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. - * - * @return the moRefId value. - */ - public String moRefId() { - return this.innerProperties() == null ? null : this.innerProperties().moRefId(); - } - - /** - * Set the moRefId property: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. - * - * @param moRefId the moRefId value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withMoRefId(String moRefId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withMoRefId(moRefId); - return this; - } - - /** - * Get the inventoryItemId property: Gets or sets the inventory Item ID for the virtual machine. - * - * @return the inventoryItemId value. - */ - public String inventoryItemId() { - return this.innerProperties() == null ? null : this.innerProperties().inventoryItemId(); - } - - /** - * Set the inventoryItemId property: Gets or sets the inventory Item ID for the virtual machine. - * - * @param inventoryItemId the inventoryItemId value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withInventoryItemId(String inventoryItemId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withInventoryItemId(inventoryItemId); - return this; - } - - /** - * Get the moName property: Gets or sets the vCenter Managed Object name for the virtual machine. - * - * @return the moName value. - */ - public String moName() { - return this.innerProperties() == null ? null : this.innerProperties().moName(); - } - - /** - * Get the folderPath property: Gets or sets the folder path of the vm. - * - * @return the folderPath value. - */ - public String folderPath() { - return this.innerProperties() == null ? null : this.innerProperties().folderPath(); - } - - /** - * Get the instanceUuid property: Gets or sets the instance uuid of the vm. - * - * @return the instanceUuid value. - */ - public String instanceUuid() { - return this.innerProperties() == null ? null : this.innerProperties().instanceUuid(); - } - - /** - * Get the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm. - * - * @return the smbiosUuid value. - */ - public String smbiosUuid() { - return this.innerProperties() == null ? null : this.innerProperties().smbiosUuid(); - } - - /** - * Set the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm. - * - * @param smbiosUuid the smbiosUuid value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withSmbiosUuid(String smbiosUuid) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withSmbiosUuid(smbiosUuid); - return this; - } - - /** - * Get the firmwareType property: Firmware type. - * - * @return the firmwareType value. - */ - public FirmwareType firmwareType() { - return this.innerProperties() == null ? null : this.innerProperties().firmwareType(); - } - - /** - * Set the firmwareType property: Firmware type. - * - * @param firmwareType the firmwareType value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withFirmwareType(FirmwareType firmwareType) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withFirmwareType(firmwareType); - return this; - } - - /** - * Get the powerState property: Gets the power state of the virtual machine. - * - * @return the powerState value. - */ - public String powerState() { - return this.innerProperties() == null ? null : this.innerProperties().powerState(); - } - - /** - * Get the customResourceName property: Gets the name of the corresponding resource in Kubernetes. - * - * @return the customResourceName value. - */ - public String customResourceName() { - return this.innerProperties() == null ? null : this.innerProperties().customResourceName(); - } - - /** - * Get the uuid property: Gets or sets a unique identifier for this resource. - * - * @return the uuid value. - */ - public String uuid() { - return this.innerProperties() == null ? null : this.innerProperties().uuid(); - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.innerProperties() == null ? null : this.innerProperties().statuses(); - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the vmId property: Gets or sets a unique identifier for the vm resource. - * - * @return the vmId value. - */ - public String vmId() { - return this.innerProperties() == null ? null : this.innerProperties().vmId(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model VirtualMachineInner")); - } else { - innerProperties().validate(); - } - if (extendedLocation() != null) { - extendedLocation().validate(); - } - if (identity() != null) { - identity().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInner.class); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstallPatchesResultInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstallPatchesResultInner.java deleted file mode 100644 index 1cd71ac1ddaf..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstallPatchesResultInner.java +++ /dev/null @@ -1,269 +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.connectedvmware.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.connectedvmware.models.ErrorDetail; -import com.azure.resourcemanager.connectedvmware.models.OsTypeUM; -import com.azure.resourcemanager.connectedvmware.models.PatchOperationStartedBy; -import com.azure.resourcemanager.connectedvmware.models.PatchOperationStatus; -import com.azure.resourcemanager.connectedvmware.models.PatchServiceUsed; -import com.azure.resourcemanager.connectedvmware.models.VMGuestPatchRebootStatus; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The result summary of an installation operation. */ -@Immutable -public final class VirtualMachineInstallPatchesResultInner { - /* - * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - * At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private PatchOperationStatus status; - - /* - * The activity ID of the operation that produced this result. - */ - @JsonProperty(value = "installationActivityId", access = JsonProperty.Access.WRITE_ONLY) - private String installationActivityId; - - /* - * The reboot state of the VM following completion of the operation. - */ - @JsonProperty(value = "rebootStatus", access = JsonProperty.Access.WRITE_ONLY) - private VMGuestPatchRebootStatus rebootStatus; - - /* - * Whether the operation ran out of time before it completed all its intended actions. - */ - @JsonProperty(value = "maintenanceWindowExceeded", access = JsonProperty.Access.WRITE_ONLY) - private Boolean maintenanceWindowExceeded; - - /* - * The number of patches that were not installed due to the user blocking their installation. - */ - @JsonProperty(value = "excludedPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer excludedPatchCount; - - /* - * The number of patches that were detected as available for install, but did not meet the operation's criteria. - */ - @JsonProperty(value = "notSelectedPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer notSelectedPatchCount; - - /* - * The number of patches that were identified as meeting the installation criteria, but were not able to be - * installed. Typically this happens when maintenanceWindowExceeded == true. - */ - @JsonProperty(value = "pendingPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer pendingPatchCount; - - /* - * The number of patches successfully installed. - */ - @JsonProperty(value = "installedPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer installedPatchCount; - - /* - * The number of patches that could not be installed due to some issue. See errors for details. - */ - @JsonProperty(value = "failedPatchCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedPatchCount; - - /* - * The UTC timestamp when the operation began. - */ - @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startDateTime; - - /* - * The UTC timestamp when the operation finished. - */ - @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedDateTime; - - /* - * Indicates if operation was triggered by user or by platform. - */ - @JsonProperty(value = "startedBy", access = JsonProperty.Access.WRITE_ONLY) - private PatchOperationStartedBy startedBy; - - /* - * Specifies the patch service used for the operation. - */ - @JsonProperty(value = "patchServiceUsed", access = JsonProperty.Access.WRITE_ONLY) - private PatchServiceUsed patchServiceUsed; - - /* - * The operating system type of the machine. - */ - @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) - private OsTypeUM osType; - - /* - * Error details. - * - * The errors that were encountered during execution of the operation. The details array contains the list of them. - */ - @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) - private ErrorDetail errorDetails; - - /** - * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until - * the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or - * "CompletedWithWarnings.". - * - * @return the status value. - */ - public PatchOperationStatus status() { - return this.status; - } - - /** - * Get the installationActivityId property: The activity ID of the operation that produced this result. - * - * @return the installationActivityId value. - */ - public String installationActivityId() { - return this.installationActivityId; - } - - /** - * Get the rebootStatus property: The reboot state of the VM following completion of the operation. - * - * @return the rebootStatus value. - */ - public VMGuestPatchRebootStatus rebootStatus() { - return this.rebootStatus; - } - - /** - * Get the maintenanceWindowExceeded property: Whether the operation ran out of time before it completed all its - * intended actions. - * - * @return the maintenanceWindowExceeded value. - */ - public Boolean maintenanceWindowExceeded() { - return this.maintenanceWindowExceeded; - } - - /** - * Get the excludedPatchCount property: The number of patches that were not installed due to the user blocking their - * installation. - * - * @return the excludedPatchCount value. - */ - public Integer excludedPatchCount() { - return this.excludedPatchCount; - } - - /** - * Get the notSelectedPatchCount property: The number of patches that were detected as available for install, but - * did not meet the operation's criteria. - * - * @return the notSelectedPatchCount value. - */ - public Integer notSelectedPatchCount() { - return this.notSelectedPatchCount; - } - - /** - * Get the pendingPatchCount property: The number of patches that were identified as meeting the installation - * criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. - * - * @return the pendingPatchCount value. - */ - public Integer pendingPatchCount() { - return this.pendingPatchCount; - } - - /** - * Get the installedPatchCount property: The number of patches successfully installed. - * - * @return the installedPatchCount value. - */ - public Integer installedPatchCount() { - return this.installedPatchCount; - } - - /** - * Get the failedPatchCount property: The number of patches that could not be installed due to some issue. See - * errors for details. - * - * @return the failedPatchCount value. - */ - public Integer failedPatchCount() { - return this.failedPatchCount; - } - - /** - * Get the startDateTime property: The UTC timestamp when the operation began. - * - * @return the startDateTime value. - */ - public OffsetDateTime startDateTime() { - return this.startDateTime; - } - - /** - * Get the lastModifiedDateTime property: The UTC timestamp when the operation finished. - * - * @return the lastModifiedDateTime value. - */ - public OffsetDateTime lastModifiedDateTime() { - return this.lastModifiedDateTime; - } - - /** - * Get the startedBy property: Indicates if operation was triggered by user or by platform. - * - * @return the startedBy value. - */ - public PatchOperationStartedBy startedBy() { - return this.startedBy; - } - - /** - * Get the patchServiceUsed property: Specifies the patch service used for the operation. - * - * @return the patchServiceUsed value. - */ - public PatchServiceUsed patchServiceUsed() { - return this.patchServiceUsed; - } - - /** - * Get the osType property: The operating system type of the machine. - * - * @return the osType value. - */ - public OsTypeUM osType() { - return this.osType; - } - - /** - * Get the errorDetails property: Error details. - * - *

The errors that were encountered during execution of the operation. The details array contains the list of - * them. - * - * @return the errorDetails value. - */ - public ErrorDetail errorDetails() { - return this.errorDetails; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errorDetails() != null) { - errorDetails().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstanceInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstanceInner.java new file mode 100644 index 000000000000..dff39a7ad401 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstanceInner.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; +import com.azure.resourcemanager.connectedvmware.models.InfrastructureProfile; +import com.azure.resourcemanager.connectedvmware.models.NetworkProfile; +import com.azure.resourcemanager.connectedvmware.models.OsProfileForVMInstance; +import com.azure.resourcemanager.connectedvmware.models.PlacementProfile; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; +import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; +import com.azure.resourcemanager.connectedvmware.models.SecurityProfile; +import com.azure.resourcemanager.connectedvmware.models.StorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Define the virtualMachineInstance. */ +@Fluent +public final class VirtualMachineInstanceInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private VirtualMachineInstanceProperties innerProperties = new VirtualMachineInstanceProperties(); + + /* + * Gets or sets the extended location. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of VirtualMachineInstanceInner class. */ + public VirtualMachineInstanceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private VirtualMachineInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extendedLocation property: Gets or sets the extended location. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: Gets or sets the extended location. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the placementProfile property: Placement properties. + * + * @return the placementProfile value. + */ + public PlacementProfile placementProfile() { + return this.innerProperties() == null ? null : this.innerProperties().placementProfile(); + } + + /** + * Set the placementProfile property: Placement properties. + * + * @param placementProfile the placementProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withPlacementProfile(PlacementProfile placementProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withPlacementProfile(placementProfile); + return this; + } + + /** + * Get the osProfile property: OS properties. + * + * @return the osProfile value. + */ + public OsProfileForVMInstance osProfile() { + return this.innerProperties() == null ? null : this.innerProperties().osProfile(); + } + + /** + * Set the osProfile property: OS properties. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withOsProfile(OsProfileForVMInstance osProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the hardwareProfile property: Hardware properties. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); + } + + /** + * Set the hardwareProfile property: Hardware properties. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withHardwareProfile(HardwareProfile hardwareProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withHardwareProfile(hardwareProfile); + return this; + } + + /** + * Get the networkProfile property: Network properties. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + + /** + * Set the networkProfile property: Network properties. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withNetworkProfile(NetworkProfile networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); + return this; + } + + /** + * Get the storageProfile property: Storage properties. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); + } + + /** + * Set the storageProfile property: Storage properties. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withStorageProfile(StorageProfile storageProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the securityProfile property: Gets the security profile. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); + } + + /** + * Set the securityProfile property: Gets the security profile. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withSecurityProfile(SecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the infrastructureProfile property: Gets the infrastructure profile. + * + * @return the infrastructureProfile value. + */ + public InfrastructureProfile infrastructureProfile() { + return this.innerProperties() == null ? null : this.innerProperties().infrastructureProfile(); + } + + /** + * Set the infrastructureProfile property: Gets the infrastructure profile. + * + * @param infrastructureProfile the infrastructureProfile value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withInfrastructureProfile(InfrastructureProfile infrastructureProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceProperties(); + } + this.innerProperties().withInfrastructureProfile(infrastructureProfile); + return this; + } + + /** + * Get the powerState property: Gets the power state of the virtual machine. + * + * @return the powerState value. + */ + public String powerState() { + return this.innerProperties() == null ? null : this.innerProperties().powerState(); + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerProperties() == null ? null : this.innerProperties().statuses(); + } + + /** + * Get the provisioningState property: Gets the provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceUid property: Gets or sets a unique identifier for the vm resource. + * + * @return the resourceUid value. + */ + public String resourceUid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceUid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model VirtualMachineInstanceInner")); + } else { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstanceInner.class); +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstanceProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstanceProperties.java new file mode 100644 index 000000000000..ac4897c091a6 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstanceProperties.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; +import com.azure.resourcemanager.connectedvmware.models.InfrastructureProfile; +import com.azure.resourcemanager.connectedvmware.models.NetworkProfile; +import com.azure.resourcemanager.connectedvmware.models.OsProfileForVMInstance; +import com.azure.resourcemanager.connectedvmware.models.PlacementProfile; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; +import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; +import com.azure.resourcemanager.connectedvmware.models.SecurityProfile; +import com.azure.resourcemanager.connectedvmware.models.StorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the properties of a Virtual Machine Instance. */ +@Fluent +public final class VirtualMachineInstanceProperties { + /* + * Placement properties. + */ + @JsonProperty(value = "placementProfile") + private PlacementProfile placementProfile; + + /* + * OS properties. + */ + @JsonProperty(value = "osProfile") + private OsProfileForVMInstance osProfile; + + /* + * Hardware properties. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * Network properties. + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + + /* + * Storage properties. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /* + * Gets the security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * Gets the infrastructure profile. + */ + @JsonProperty(value = "infrastructureProfile") + private InfrastructureProfile infrastructureProfile; + + /* + * Gets the power state of the virtual machine. + */ + @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) + private String powerState; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /* + * Gets the provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Gets or sets a unique identifier for the vm resource. + */ + @JsonProperty(value = "resourceUid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceUid; + + /** Creates an instance of VirtualMachineInstanceProperties class. */ + public VirtualMachineInstanceProperties() { + } + + /** + * Get the placementProfile property: Placement properties. + * + * @return the placementProfile value. + */ + public PlacementProfile placementProfile() { + return this.placementProfile; + } + + /** + * Set the placementProfile property: Placement properties. + * + * @param placementProfile the placementProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withPlacementProfile(PlacementProfile placementProfile) { + this.placementProfile = placementProfile; + return this; + } + + /** + * Get the osProfile property: OS properties. + * + * @return the osProfile value. + */ + public OsProfileForVMInstance osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: OS properties. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withOsProfile(OsProfileForVMInstance osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the hardwareProfile property: Hardware properties. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Hardware properties. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the networkProfile property: Network properties. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Network properties. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the storageProfile property: Storage properties. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Storage properties. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the securityProfile property: Gets the security profile. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Gets the security profile. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the infrastructureProfile property: Gets the infrastructure profile. + * + * @return the infrastructureProfile value. + */ + public InfrastructureProfile infrastructureProfile() { + return this.infrastructureProfile; + } + + /** + * Set the infrastructureProfile property: Gets the infrastructure profile. + * + * @param infrastructureProfile the infrastructureProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withInfrastructureProfile(InfrastructureProfile infrastructureProfile) { + this.infrastructureProfile = infrastructureProfile; + return this; + } + + /** + * Get the powerState property: Gets the power state of the virtual machine. + * + * @return the powerState value. + */ + public String powerState() { + return this.powerState; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Get the provisioningState property: Gets the provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceUid property: Gets or sets a unique identifier for the vm resource. + * + * @return the resourceUid value. + */ + public String resourceUid() { + return this.resourceUid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (placementProfile() != null) { + placementProfile().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (infrastructureProfile() != null) { + infrastructureProfile().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineUpdateProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstanceUpdateProperties.java similarity index 53% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineUpdateProperties.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstanceUpdateProperties.java index 68335caa2ef5..2bf3c186cb32 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineUpdateProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineInstanceUpdateProperties.java @@ -7,39 +7,36 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; import com.azure.resourcemanager.connectedvmware.models.NetworkProfileUpdate; -import com.azure.resourcemanager.connectedvmware.models.OsProfileUpdate; import com.azure.resourcemanager.connectedvmware.models.StorageProfileUpdate; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** Describes the properties of a Virtual Machine. */ @Fluent -public final class VirtualMachineUpdateProperties { +public final class VirtualMachineInstanceUpdateProperties { /* - * Defines the resource properties. + * Specifies the hardware settings for the virtual machine. */ @JsonProperty(value = "hardwareProfile") private HardwareProfile hardwareProfile; /* - * OS properties. - */ - @JsonProperty(value = "osProfile") - private OsProfileUpdate osProfile; - - /* - * Defines the resource update properties. + * Specifies the storage settings for the virtual machine disks. */ @JsonProperty(value = "storageProfile") private StorageProfileUpdate storageProfile; /* - * Defines the update resource properties. + * Specifies the network interfaces of the virtual machine. */ @JsonProperty(value = "networkProfile") private NetworkProfileUpdate networkProfile; + /** Creates an instance of VirtualMachineInstanceUpdateProperties class. */ + public VirtualMachineInstanceUpdateProperties() { + } + /** - * Get the hardwareProfile property: Defines the resource properties. + * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. * * @return the hardwareProfile value. */ @@ -48,38 +45,18 @@ public HardwareProfile hardwareProfile() { } /** - * Set the hardwareProfile property: Defines the resource properties. + * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. * * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineUpdateProperties object itself. + * @return the VirtualMachineInstanceUpdateProperties object itself. */ - public VirtualMachineUpdateProperties withHardwareProfile(HardwareProfile hardwareProfile) { + public VirtualMachineInstanceUpdateProperties withHardwareProfile(HardwareProfile hardwareProfile) { this.hardwareProfile = hardwareProfile; return this; } /** - * Get the osProfile property: OS properties. - * - * @return the osProfile value. - */ - public OsProfileUpdate osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: OS properties. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineUpdateProperties object itself. - */ - public VirtualMachineUpdateProperties withOsProfile(OsProfileUpdate osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the storageProfile property: Defines the resource update properties. + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. * * @return the storageProfile value. */ @@ -88,18 +65,18 @@ public StorageProfileUpdate storageProfile() { } /** - * Set the storageProfile property: Defines the resource update properties. + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. * * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineUpdateProperties object itself. + * @return the VirtualMachineInstanceUpdateProperties object itself. */ - public VirtualMachineUpdateProperties withStorageProfile(StorageProfileUpdate storageProfile) { + public VirtualMachineInstanceUpdateProperties withStorageProfile(StorageProfileUpdate storageProfile) { this.storageProfile = storageProfile; return this; } /** - * Get the networkProfile property: Defines the update resource properties. + * Get the networkProfile property: Specifies the network interfaces of the virtual machine. * * @return the networkProfile value. */ @@ -108,12 +85,12 @@ public NetworkProfileUpdate networkProfile() { } /** - * Set the networkProfile property: Defines the update resource properties. + * Set the networkProfile property: Specifies the network interfaces of the virtual machine. * * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineUpdateProperties object itself. + * @return the VirtualMachineInstanceUpdateProperties object itself. */ - public VirtualMachineUpdateProperties withNetworkProfile(NetworkProfileUpdate networkProfile) { + public VirtualMachineInstanceUpdateProperties withNetworkProfile(NetworkProfileUpdate networkProfile) { this.networkProfile = networkProfile; return this; } @@ -127,9 +104,6 @@ public void validate() { if (hardwareProfile() != null) { hardwareProfile().validate(); } - if (osProfile() != null) { - osProfile().validate(); - } if (storageProfile() != null) { storageProfile().validate(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineProperties.java deleted file mode 100644 index 139c8476b324..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineProperties.java +++ /dev/null @@ -1,556 +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.connectedvmware.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.models.FirmwareType; -import com.azure.resourcemanager.connectedvmware.models.GuestAgentProfile; -import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; -import com.azure.resourcemanager.connectedvmware.models.NetworkProfile; -import com.azure.resourcemanager.connectedvmware.models.OsProfile; -import com.azure.resourcemanager.connectedvmware.models.PlacementProfile; -import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; -import com.azure.resourcemanager.connectedvmware.models.SecurityProfile; -import com.azure.resourcemanager.connectedvmware.models.StorageProfile; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Defines the resource properties. */ -@Fluent -public final class VirtualMachineProperties { - /* - * Gets or sets the ARM Id of the resourcePool resource on which this virtual machine will - * deploy. - */ - @JsonProperty(value = "resourcePoolId") - private String resourcePoolId; - - /* - * Gets or sets the ARM Id of the template resource to deploy the virtual machine. - */ - @JsonProperty(value = "templateId") - private String templateId; - - /* - * Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. - */ - @JsonProperty(value = "vCenterId") - private String vCenterId; - - /* - * Placement properties. - */ - @JsonProperty(value = "placementProfile") - private PlacementProfile placementProfile; - - /* - * OS properties. - */ - @JsonProperty(value = "osProfile") - private OsProfile osProfile; - - /* - * Hardware properties. - */ - @JsonProperty(value = "hardwareProfile") - private HardwareProfile hardwareProfile; - - /* - * Network properties. - */ - @JsonProperty(value = "networkProfile") - private NetworkProfile networkProfile; - - /* - * Storage properties. - */ - @JsonProperty(value = "storageProfile") - private StorageProfile storageProfile; - - /* - * Guest agent status properties. - */ - @JsonProperty(value = "guestAgentProfile") - private GuestAgentProfile guestAgentProfile; - - /* - * Gets the security profile. - */ - @JsonProperty(value = "securityProfile") - private SecurityProfile securityProfile; - - /* - * Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. - */ - @JsonProperty(value = "moRefId") - private String moRefId; - - /* - * Gets or sets the inventory Item ID for the virtual machine. - */ - @JsonProperty(value = "inventoryItemId") - private String inventoryItemId; - - /* - * Gets or sets the vCenter Managed Object name for the virtual machine. - */ - @JsonProperty(value = "moName", access = JsonProperty.Access.WRITE_ONLY) - private String moName; - - /* - * Gets or sets the folder path of the vm. - */ - @JsonProperty(value = "folderPath", access = JsonProperty.Access.WRITE_ONLY) - private String folderPath; - - /* - * Gets or sets the instance uuid of the vm. - */ - @JsonProperty(value = "instanceUuid", access = JsonProperty.Access.WRITE_ONLY) - private String instanceUuid; - - /* - * Gets or sets the SMBIOS UUID of the vm. - */ - @JsonProperty(value = "smbiosUuid") - private String smbiosUuid; - - /* - * Firmware type - */ - @JsonProperty(value = "firmwareType") - private FirmwareType firmwareType; - - /* - * Gets the power state of the virtual machine. - */ - @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) - private String powerState; - - /* - * Gets the name of the corresponding resource in Kubernetes. - */ - @JsonProperty(value = "customResourceName", access = JsonProperty.Access.WRITE_ONLY) - private String customResourceName; - - /* - * Gets or sets a unique identifier for this resource. - */ - @JsonProperty(value = "uuid", access = JsonProperty.Access.WRITE_ONLY) - private String uuid; - - /* - * The resource status information. - */ - @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY) - private List statuses; - - /* - * Gets or sets the provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Gets or sets a unique identifier for the vm resource. - */ - @JsonProperty(value = "vmId", access = JsonProperty.Access.WRITE_ONLY) - private String vmId; - - /** - * Get the resourcePoolId property: Gets or sets the ARM Id of the resourcePool resource on which this virtual - * machine will deploy. - * - * @return the resourcePoolId value. - */ - public String resourcePoolId() { - return this.resourcePoolId; - } - - /** - * Set the resourcePoolId property: Gets or sets the ARM Id of the resourcePool resource on which this virtual - * machine will deploy. - * - * @param resourcePoolId the resourcePoolId value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withResourcePoolId(String resourcePoolId) { - this.resourcePoolId = resourcePoolId; - return this; - } - - /** - * Get the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual machine. - * - * @return the templateId value. - */ - public String templateId() { - return this.templateId; - } - - /** - * Set the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual machine. - * - * @param templateId the templateId value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withTemplateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * Get the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. - * - * @return the vCenterId value. - */ - public String vCenterId() { - return this.vCenterId; - } - - /** - * Set the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. - * - * @param vCenterId the vCenterId value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withVCenterId(String vCenterId) { - this.vCenterId = vCenterId; - return this; - } - - /** - * Get the placementProfile property: Placement properties. - * - * @return the placementProfile value. - */ - public PlacementProfile placementProfile() { - return this.placementProfile; - } - - /** - * Set the placementProfile property: Placement properties. - * - * @param placementProfile the placementProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withPlacementProfile(PlacementProfile placementProfile) { - this.placementProfile = placementProfile; - return this; - } - - /** - * Get the osProfile property: OS properties. - * - * @return the osProfile value. - */ - public OsProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: OS properties. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withOsProfile(OsProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the hardwareProfile property: Hardware properties. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.hardwareProfile; - } - - /** - * Set the hardwareProfile property: Hardware properties. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withHardwareProfile(HardwareProfile hardwareProfile) { - this.hardwareProfile = hardwareProfile; - return this; - } - - /** - * Get the networkProfile property: Network properties. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: Network properties. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withNetworkProfile(NetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the storageProfile property: Storage properties. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Storage properties. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withStorageProfile(StorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the guestAgentProfile property: Guest agent status properties. - * - * @return the guestAgentProfile value. - */ - public GuestAgentProfile guestAgentProfile() { - return this.guestAgentProfile; - } - - /** - * Set the guestAgentProfile property: Guest agent status properties. - * - * @param guestAgentProfile the guestAgentProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withGuestAgentProfile(GuestAgentProfile guestAgentProfile) { - this.guestAgentProfile = guestAgentProfile; - return this; - } - - /** - * Get the securityProfile property: Gets the security profile. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.securityProfile; - } - - /** - * Set the securityProfile property: Gets the security profile. - * - * @param securityProfile the securityProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withSecurityProfile(SecurityProfile securityProfile) { - this.securityProfile = securityProfile; - return this; - } - - /** - * Get the moRefId property: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. - * - * @return the moRefId value. - */ - public String moRefId() { - return this.moRefId; - } - - /** - * Set the moRefId property: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. - * - * @param moRefId the moRefId value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withMoRefId(String moRefId) { - this.moRefId = moRefId; - return this; - } - - /** - * Get the inventoryItemId property: Gets or sets the inventory Item ID for the virtual machine. - * - * @return the inventoryItemId value. - */ - public String inventoryItemId() { - return this.inventoryItemId; - } - - /** - * Set the inventoryItemId property: Gets or sets the inventory Item ID for the virtual machine. - * - * @param inventoryItemId the inventoryItemId value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withInventoryItemId(String inventoryItemId) { - this.inventoryItemId = inventoryItemId; - return this; - } - - /** - * Get the moName property: Gets or sets the vCenter Managed Object name for the virtual machine. - * - * @return the moName value. - */ - public String moName() { - return this.moName; - } - - /** - * Get the folderPath property: Gets or sets the folder path of the vm. - * - * @return the folderPath value. - */ - public String folderPath() { - return this.folderPath; - } - - /** - * Get the instanceUuid property: Gets or sets the instance uuid of the vm. - * - * @return the instanceUuid value. - */ - public String instanceUuid() { - return this.instanceUuid; - } - - /** - * Get the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm. - * - * @return the smbiosUuid value. - */ - public String smbiosUuid() { - return this.smbiosUuid; - } - - /** - * Set the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm. - * - * @param smbiosUuid the smbiosUuid value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withSmbiosUuid(String smbiosUuid) { - this.smbiosUuid = smbiosUuid; - return this; - } - - /** - * Get the firmwareType property: Firmware type. - * - * @return the firmwareType value. - */ - public FirmwareType firmwareType() { - return this.firmwareType; - } - - /** - * Set the firmwareType property: Firmware type. - * - * @param firmwareType the firmwareType value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withFirmwareType(FirmwareType firmwareType) { - this.firmwareType = firmwareType; - return this; - } - - /** - * Get the powerState property: Gets the power state of the virtual machine. - * - * @return the powerState value. - */ - public String powerState() { - return this.powerState; - } - - /** - * Get the customResourceName property: Gets the name of the corresponding resource in Kubernetes. - * - * @return the customResourceName value. - */ - public String customResourceName() { - return this.customResourceName; - } - - /** - * Get the uuid property: Gets or sets a unique identifier for this resource. - * - * @return the uuid value. - */ - public String uuid() { - return this.uuid; - } - - /** - * Get the statuses property: The resource status information. - * - * @return the statuses value. - */ - public List statuses() { - return this.statuses; - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the vmId property: Gets or sets a unique identifier for the vm resource. - * - * @return the vmId value. - */ - public String vmId() { - return this.vmId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (placementProfile() != null) { - placementProfile().validate(); - } - if (osProfile() != null) { - osProfile().validate(); - } - if (hardwareProfile() != null) { - hardwareProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - if (guestAgentProfile() != null) { - guestAgentProfile().validate(); - } - if (securityProfile() != null) { - securityProfile().validate(); - } - if (statuses() != null) { - statuses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineTemplateInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineTemplateInner.java index 2289b225c2cb..1525e09dd3c7 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineTemplateInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineTemplateInner.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.connectedvmware.models.FirmwareType; import com.azure.resourcemanager.connectedvmware.models.NetworkInterface; import com.azure.resourcemanager.connectedvmware.models.OsType; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.azure.resourcemanager.connectedvmware.models.VirtualDisk; import com.fasterxml.jackson.annotation.JsonProperty; @@ -47,6 +48,10 @@ public final class VirtualMachineTemplateInner extends Resource { @JsonProperty(value = "kind") private String kind; + /** Creates an instance of VirtualMachineTemplateInner class. */ + public VirtualMachineTemplateInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -332,11 +337,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineTemplateProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineTemplateProperties.java index e2a384f35214..3e471ab115d1 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineTemplateProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualMachineTemplateProperties.java @@ -8,12 +8,13 @@ import com.azure.resourcemanager.connectedvmware.models.FirmwareType; import com.azure.resourcemanager.connectedvmware.models.NetworkInterface; import com.azure.resourcemanager.connectedvmware.models.OsType; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.azure.resourcemanager.connectedvmware.models.VirtualDisk; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Describes the properties of a Virtual Machine Template. */ @Fluent public final class VirtualMachineTemplateProperties { /* @@ -127,10 +128,14 @@ public final class VirtualMachineTemplateProperties { private List statuses; /* - * Gets or sets the provisioning state. + * Gets the provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** Creates an instance of VirtualMachineTemplateProperties class. */ + public VirtualMachineTemplateProperties() { + } /** * Get the uuid property: Gets or sets a unique identifier for this resource. @@ -332,11 +337,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualNetworkInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualNetworkInner.java index bd5dcd3d145a..a1be1c9fb84e 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualNetworkInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualNetworkInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -43,6 +44,10 @@ public final class VirtualNetworkInner extends Resource { @JsonProperty(value = "kind") private String kind; + /** Creates an instance of VirtualNetworkInner class. */ + public VirtualNetworkInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -225,11 +230,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualNetworkProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualNetworkProperties.java index 297eb20bbde6..6433bb1789b3 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualNetworkProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VirtualNetworkProperties.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.connectedvmware.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Describes the properties of a Virtual Network. */ @Fluent public final class VirtualNetworkProperties { /* @@ -55,10 +56,14 @@ public final class VirtualNetworkProperties { private List statuses; /* - * Gets or sets the provisioning state. + * Gets the provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** Creates an instance of VirtualNetworkProperties class. */ + public VirtualNetworkProperties() { + } /** * Get the uuid property: Gets or sets a unique identifier for this resource. @@ -157,11 +162,11 @@ public List statuses() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HybridIdentityMetadataInner.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VmInstanceHybridIdentityMetadataInner.java similarity index 58% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HybridIdentityMetadataInner.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VmInstanceHybridIdentityMetadataInner.java index 61ad1b6f5ad6..944127af82b6 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/HybridIdentityMetadataInner.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VmInstanceHybridIdentityMetadataInner.java @@ -8,35 +8,40 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.connectedvmware.models.Identity; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; /** Defines the HybridIdentityMetadata. */ @Fluent -public final class HybridIdentityMetadataInner extends ProxyResource { +public final class VmInstanceHybridIdentityMetadataInner extends ProxyResource { /* * Resource properties. */ @JsonProperty(value = "properties", required = true) - private HybridIdentityMetadataProperties innerProperties = new HybridIdentityMetadataProperties(); + private VmInstanceHybridIdentityMetadataProperties innerProperties = + new VmInstanceHybridIdentityMetadataProperties(); /* - * The system data. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of VmInstanceHybridIdentityMetadataInner class. */ + public VmInstanceHybridIdentityMetadataInner() { + } + /** * Get the innerProperties property: Resource properties. * * @return the innerProperties value. */ - private HybridIdentityMetadataProperties innerProperties() { + private VmInstanceHybridIdentityMetadataProperties innerProperties() { return this.innerProperties; } /** - * Get the systemData property: The system data. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -45,25 +50,25 @@ public SystemData systemData() { } /** - * Get the vmId property: Gets or sets the Vm Id. + * Get the resourceUid property: The unique identifier for the resource. * - * @return the vmId value. + * @return the resourceUid value. */ - public String vmId() { - return this.innerProperties() == null ? null : this.innerProperties().vmId(); + public String resourceUid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceUid(); } /** - * Set the vmId property: Gets or sets the Vm Id. + * Set the resourceUid property: The unique identifier for the resource. * - * @param vmId the vmId value to set. - * @return the HybridIdentityMetadataInner object itself. + * @param resourceUid the resourceUid value to set. + * @return the VmInstanceHybridIdentityMetadataInner object itself. */ - public HybridIdentityMetadataInner withVmId(String vmId) { + public VmInstanceHybridIdentityMetadataInner withResourceUid(String resourceUid) { if (this.innerProperties() == null) { - this.innerProperties = new HybridIdentityMetadataProperties(); + this.innerProperties = new VmInstanceHybridIdentityMetadataProperties(); } - this.innerProperties().withVmId(vmId); + this.innerProperties().withResourceUid(resourceUid); return this; } @@ -80,31 +85,22 @@ public String publicKey() { * Set the publicKey property: Gets or sets the Public Key. * * @param publicKey the publicKey value to set. - * @return the HybridIdentityMetadataInner object itself. + * @return the VmInstanceHybridIdentityMetadataInner object itself. */ - public HybridIdentityMetadataInner withPublicKey(String publicKey) { + public VmInstanceHybridIdentityMetadataInner withPublicKey(String publicKey) { if (this.innerProperties() == null) { - this.innerProperties = new HybridIdentityMetadataProperties(); + this.innerProperties = new VmInstanceHybridIdentityMetadataProperties(); } this.innerProperties().withPublicKey(publicKey); return this; } /** - * Get the identity property: The identity of the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.innerProperties() == null ? null : this.innerProperties().identity(); - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } @@ -118,11 +114,11 @@ public void validate() { throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property innerProperties in model HybridIdentityMetadataInner")); + "Missing required property innerProperties in model VmInstanceHybridIdentityMetadataInner")); } else { innerProperties().validate(); } } - private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadataInner.class); + private static final ClientLogger LOGGER = new ClientLogger(VmInstanceHybridIdentityMetadataInner.class); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VmInstanceHybridIdentityMetadataProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VmInstanceHybridIdentityMetadataProperties.java new file mode 100644 index 000000000000..59d3936df1d1 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/VmInstanceHybridIdentityMetadataProperties.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of Hybrid Identity Metadata for a Virtual Machine. */ +@Fluent +public final class VmInstanceHybridIdentityMetadataProperties { + /* + * The unique identifier for the resource. + */ + @JsonProperty(value = "resourceUid") + private String resourceUid; + + /* + * Gets or sets the Public Key. + */ + @JsonProperty(value = "publicKey") + private String publicKey; + + /* + * Gets the provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of VmInstanceHybridIdentityMetadataProperties class. */ + public VmInstanceHybridIdentityMetadataProperties() { + } + + /** + * Get the resourceUid property: The unique identifier for the resource. + * + * @return the resourceUid value. + */ + public String resourceUid() { + return this.resourceUid; + } + + /** + * Set the resourceUid property: The unique identifier for the resource. + * + * @param resourceUid the resourceUid value to set. + * @return the VmInstanceHybridIdentityMetadataProperties object itself. + */ + public VmInstanceHybridIdentityMetadataProperties withResourceUid(String resourceUid) { + this.resourceUid = resourceUid; + return this; + } + + /** + * Get the publicKey property: Gets or sets the Public Key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: Gets or sets the Public Key. + * + * @param publicKey the publicKey value to set. + * @return the VmInstanceHybridIdentityMetadataProperties object itself. + */ + public VmInstanceHybridIdentityMetadataProperties withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClusterImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClusterImpl.java index edb6c492a561..eaa86a82c323 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClusterImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClusterImpl.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.connectedvmware.fluent.models.ClusterInner; import com.azure.resourcemanager.connectedvmware.models.Cluster; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourcePatch; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import java.util.Collections; @@ -91,6 +92,22 @@ public String customResourceName() { return this.innerModel().customResourceName(); } + public Long usedMemoryGB() { + return this.innerModel().usedMemoryGB(); + } + + public Long totalMemoryGB() { + return this.innerModel().totalMemoryGB(); + } + + public Long usedCpuMHz() { + return this.innerModel().usedCpuMHz(); + } + + public Long totalCpuMHz() { + return this.innerModel().totalCpuMHz(); + } + public List datastoreIds() { List inner = this.innerModel().datastoreIds(); if (inner != null) { @@ -109,7 +126,7 @@ public List networkIds() { } } - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClustersClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClustersClientImpl.java index 8860227c8a5e..a632da9f4c2d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClustersClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClustersClientImpl.java @@ -64,11 +64,10 @@ public final class ClustersClientImpl implements ClustersClient { */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface ClustersService { + public interface ClustersService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -83,8 +82,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -98,8 +96,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -114,8 +111,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -141,8 +137,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/clusters") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -305,6 +300,29 @@ private PollerFlux, ClusterInner> beginCreateAsync( mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); } + /** + * Implements cluster PUT method. + * + *

Create Or Update cluster. + * + * @param resourceGroupName The Resource Group Name. + * @param clusterName 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 {@link PollerFlux} for polling of define the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginCreateAsync( + String resourceGroupName, String clusterName) { + final ClusterInner body = null; + Mono>> mono = createWithResponseAsync(resourceGroupName, clusterName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + /** * Implements cluster PUT method. * @@ -337,7 +355,6 @@ private PollerFlux, ClusterInner> beginCreateAsync( * * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -345,8 +362,9 @@ private PollerFlux, ClusterInner> beginCreateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreate( - String resourceGroupName, String clusterName, ClusterInner body) { - return beginCreateAsync(resourceGroupName, clusterName, body).getSyncPoller(); + String resourceGroupName, String clusterName) { + final ClusterInner body = null; + return this.beginCreateAsync(resourceGroupName, clusterName, body).getSyncPoller(); } /** @@ -366,7 +384,7 @@ public SyncPoller, ClusterInner> beginCreate( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner body, Context context) { - return beginCreateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); } /** @@ -431,24 +449,6 @@ private Mono createAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Implements cluster PUT method. - * - *

Create Or Update cluster. - * - * @param resourceGroupName The Resource Group Name. - * @param clusterName Name of the cluster. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner body) { - return createAsync(resourceGroupName, clusterName, body).block(); - } - /** * Implements cluster PUT method. * @@ -609,14 +609,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * * @param resourceGroupName The Resource Group Name. * @param clusterName 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 define the cluster. + * @return define the cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); } /** @@ -626,16 +628,14 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN * * @param resourceGroupName The Resource Group Name. * @param clusterName 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 define the cluster along with {@link Response}. + * @return define the cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); } /** @@ -753,14 +753,14 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. - * @param body Resource properties to update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, ResourcePatch body) { + private Mono updateAsync(String resourceGroupName, String clusterName) { + final ResourcePatch body = null; return updateWithResponseAsync(resourceGroupName, clusterName, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -772,16 +772,17 @@ private Mono updateAsync(String resourceGroupName, String clusterN * * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. + * @param body Resource properties to update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the cluster on successful completion of {@link Mono}. + * @return define the cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName) { - final ResourcePatch body = null; - return updateWithResponseAsync(resourceGroupName, clusterName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response updateWithResponse( + String resourceGroupName, String clusterName, ResourcePatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, body, context).block(); } /** @@ -799,27 +800,7 @@ private Mono updateAsync(String resourceGroupName, String clusterN @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner update(String resourceGroupName, String clusterName) { final ResourcePatch body = null; - return updateAsync(resourceGroupName, clusterName, body).block(); - } - - /** - * Updates a cluster. - * - *

API to update certain properties of the cluster resource. - * - * @param resourceGroupName The Resource Group Name. - * @param clusterName Name of the cluster. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String clusterName, ResourcePatch body, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, body, context).block(); + return updateWithResponse(resourceGroupName, clusterName, body, Context.NONE).getValue(); } /** @@ -947,6 +928,28 @@ private PollerFlux, Void> beginDeleteAsync( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } + /** + * Deletes an cluster. + * + *

Implements cluster DELETE method. + * + * @param resourceGroupName The Resource Group Name. + * @param clusterName 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + /** * Deletes an cluster. * @@ -978,15 +981,15 @@ private PollerFlux, Void> beginDeleteAsync( * * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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> beginDelete(String resourceGroupName, String clusterName, Boolean force) { - return beginDeleteAsync(resourceGroupName, clusterName, force).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, clusterName, force).getSyncPoller(); } /** @@ -1006,7 +1009,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, force, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, clusterName, force, context).getSyncPoller(); } /** @@ -1070,23 +1073,6 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Boo .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes an cluster. - * - *

Implements cluster DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param clusterName Name of the cluster. - * @param force Whether force delete was specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 clusterName, Boolean force) { - deleteAsync(resourceGroupName, clusterName, force).block(); - } - /** * Deletes an cluster. * @@ -1452,7 +1438,8 @@ public PagedIterable listByResourceGroup(String resourceGroupName, /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1487,7 +1474,8 @@ private Mono> listNextSinglePageAsync(String nextLin /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1523,7 +1511,8 @@ private Mono> listNextSinglePageAsync(String nextLin /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1559,7 +1548,8 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClustersImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClustersImpl.java index 565d4f69c0b3..3fc10d5baafd 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClustersImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ClustersImpl.java @@ -27,15 +27,6 @@ public ClustersImpl( this.serviceManager = serviceManager; } - 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 = @@ -51,8 +42,13 @@ public Response getByResourceGroupWithResponse( } } - public void delete(String resourceGroupName, String clusterName, Boolean force) { - this.serviceClient().delete(resourceGroupName, clusterName, force); + 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 void delete(String resourceGroupName, String clusterName) { diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ConnectedVMwareClientBuilder.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ConnectedVMwareClientBuilder.java index d2f56077ee2e..8248f25fdff2 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ConnectedVMwareClientBuilder.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ConnectedVMwareClientBuilder.java @@ -137,7 +137,7 @@ public ConnectedVMwareClientImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ConnectedVMwareClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ConnectedVMwareClientImpl.java index fcff5c0fb261..4186c7e34048 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ConnectedVMwareClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ConnectedVMwareClientImpl.java @@ -25,17 +25,16 @@ import com.azure.resourcemanager.connectedvmware.fluent.ClustersClient; import com.azure.resourcemanager.connectedvmware.fluent.ConnectedVMwareClient; import com.azure.resourcemanager.connectedvmware.fluent.DatastoresClient; -import com.azure.resourcemanager.connectedvmware.fluent.GuestAgentsClient; import com.azure.resourcemanager.connectedvmware.fluent.HostsClient; -import com.azure.resourcemanager.connectedvmware.fluent.HybridIdentityMetadatasClient; import com.azure.resourcemanager.connectedvmware.fluent.InventoryItemsClient; -import com.azure.resourcemanager.connectedvmware.fluent.MachineExtensionsClient; import com.azure.resourcemanager.connectedvmware.fluent.OperationsClient; import com.azure.resourcemanager.connectedvmware.fluent.ResourcePoolsClient; import com.azure.resourcemanager.connectedvmware.fluent.VCentersClient; +import com.azure.resourcemanager.connectedvmware.fluent.VMInstanceGuestAgentsClient; +import com.azure.resourcemanager.connectedvmware.fluent.VirtualMachineInstancesClient; import com.azure.resourcemanager.connectedvmware.fluent.VirtualMachineTemplatesClient; -import com.azure.resourcemanager.connectedvmware.fluent.VirtualMachinesClient; import com.azure.resourcemanager.connectedvmware.fluent.VirtualNetworksClient; +import com.azure.resourcemanager.connectedvmware.fluent.VmInstanceHybridIdentityMetadatasClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -132,18 +131,6 @@ public OperationsClient getOperations() { return this.operations; } - /** The VirtualMachinesClient object to access its operations. */ - private final VirtualMachinesClient virtualMachines; - - /** - * Gets the VirtualMachinesClient object to access its operations. - * - * @return the VirtualMachinesClient object. - */ - public VirtualMachinesClient getVirtualMachines() { - return this.virtualMachines; - } - /** The ResourcePoolsClient object to access its operations. */ private final ResourcePoolsClient resourcePools; @@ -240,40 +227,40 @@ public InventoryItemsClient getInventoryItems() { return this.inventoryItems; } - /** The HybridIdentityMetadatasClient object to access its operations. */ - private final HybridIdentityMetadatasClient hybridIdentityMetadatas; + /** The VirtualMachineInstancesClient object to access its operations. */ + private final VirtualMachineInstancesClient virtualMachineInstances; /** - * Gets the HybridIdentityMetadatasClient object to access its operations. + * Gets the VirtualMachineInstancesClient object to access its operations. * - * @return the HybridIdentityMetadatasClient object. + * @return the VirtualMachineInstancesClient object. */ - public HybridIdentityMetadatasClient getHybridIdentityMetadatas() { - return this.hybridIdentityMetadatas; + public VirtualMachineInstancesClient getVirtualMachineInstances() { + return this.virtualMachineInstances; } - /** The MachineExtensionsClient object to access its operations. */ - private final MachineExtensionsClient machineExtensions; + /** The VmInstanceHybridIdentityMetadatasClient object to access its operations. */ + private final VmInstanceHybridIdentityMetadatasClient vmInstanceHybridIdentityMetadatas; /** - * Gets the MachineExtensionsClient object to access its operations. + * Gets the VmInstanceHybridIdentityMetadatasClient object to access its operations. * - * @return the MachineExtensionsClient object. + * @return the VmInstanceHybridIdentityMetadatasClient object. */ - public MachineExtensionsClient getMachineExtensions() { - return this.machineExtensions; + public VmInstanceHybridIdentityMetadatasClient getVmInstanceHybridIdentityMetadatas() { + return this.vmInstanceHybridIdentityMetadatas; } - /** The GuestAgentsClient object to access its operations. */ - private final GuestAgentsClient guestAgents; + /** The VMInstanceGuestAgentsClient object to access its operations. */ + private final VMInstanceGuestAgentsClient vMInstanceGuestAgents; /** - * Gets the GuestAgentsClient object to access its operations. + * Gets the VMInstanceGuestAgentsClient object to access its operations. * - * @return the GuestAgentsClient object. + * @return the VMInstanceGuestAgentsClient object. */ - public GuestAgentsClient getGuestAgents() { - return this.guestAgents; + public VMInstanceGuestAgentsClient getVMInstanceGuestAgents() { + return this.vMInstanceGuestAgents; } /** @@ -298,9 +285,8 @@ public GuestAgentsClient getGuestAgents() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-01-10-preview"; + this.apiVersion = "2023-10-01"; this.operations = new OperationsClientImpl(this); - this.virtualMachines = new VirtualMachinesClientImpl(this); this.resourcePools = new ResourcePoolsClientImpl(this); this.clusters = new ClustersClientImpl(this); this.hosts = new HostsClientImpl(this); @@ -309,9 +295,9 @@ public GuestAgentsClient getGuestAgents() { this.virtualMachineTemplates = new VirtualMachineTemplatesClientImpl(this); this.virtualNetworks = new VirtualNetworksClientImpl(this); this.inventoryItems = new InventoryItemsClientImpl(this); - this.hybridIdentityMetadatas = new HybridIdentityMetadatasClientImpl(this); - this.machineExtensions = new MachineExtensionsClientImpl(this); - this.guestAgents = new GuestAgentsClientImpl(this); + this.virtualMachineInstances = new VirtualMachineInstancesClientImpl(this); + this.vmInstanceHybridIdentityMetadatas = new VmInstanceHybridIdentityMetadatasClientImpl(this); + this.vMInstanceGuestAgents = new VMInstanceGuestAgentsClientImpl(this); } /** diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoreImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoreImpl.java index fb409dcaaa52..366722319893 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoreImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoreImpl.java @@ -92,6 +92,14 @@ public String customResourceName() { return this.innerModel().customResourceName(); } + public Long capacityGB() { + return this.innerModel().capacityGB(); + } + + public Long freeSpaceGB() { + return this.innerModel().freeSpaceGB(); + } + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoresClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoresClientImpl.java index bb70182f714d..cc59fadb80dd 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoresClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoresClientImpl.java @@ -65,11 +65,10 @@ public final class DatastoresClientImpl implements DatastoresClient { */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface DatastoresService { + public interface DatastoresService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -84,8 +83,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -99,8 +97,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -115,8 +112,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -142,8 +138,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/datastores") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -310,6 +305,33 @@ private PollerFlux, DatastoreInner> beginCreateAsync( this.client.getContext()); } + /** + * Implements datastore PUT method. + * + *

Create Or Update datastore. + * + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the datastore. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatastoreInner> beginCreateAsync( + String resourceGroupName, String datastoreName) { + final DatastoreInner body = null; + Mono>> mono = createWithResponseAsync(resourceGroupName, datastoreName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatastoreInner.class, + DatastoreInner.class, + this.client.getContext()); + } + /** * Implements datastore PUT method. * @@ -343,7 +365,6 @@ private PollerFlux, DatastoreInner> beginCreateAsync( * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -351,8 +372,9 @@ private PollerFlux, DatastoreInner> beginCreateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatastoreInner> beginCreate( - String resourceGroupName, String datastoreName, DatastoreInner body) { - return beginCreateAsync(resourceGroupName, datastoreName, body).getSyncPoller(); + String resourceGroupName, String datastoreName) { + final DatastoreInner body = null; + return this.beginCreateAsync(resourceGroupName, datastoreName, body).getSyncPoller(); } /** @@ -372,7 +394,7 @@ public SyncPoller, DatastoreInner> beginCreate( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatastoreInner> beginCreate( String resourceGroupName, String datastoreName, DatastoreInner body, Context context) { - return beginCreateAsync(resourceGroupName, datastoreName, body, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, datastoreName, body, context).getSyncPoller(); } /** @@ -437,24 +459,6 @@ private Mono createAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Implements datastore PUT method. - * - *

Create Or Update datastore. - * - * @param resourceGroupName The Resource Group Name. - * @param datastoreName Name of the datastore. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the datastore. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DatastoreInner create(String resourceGroupName, String datastoreName, DatastoreInner body) { - return createAsync(resourceGroupName, datastoreName, body).block(); - } - /** * Implements datastore PUT method. * @@ -615,14 +619,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, S * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the datastore. + * @return define the datastore along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DatastoreInner getByResourceGroup(String resourceGroupName, String datastoreName) { - return getByResourceGroupAsync(resourceGroupName, datastoreName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String datastoreName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, datastoreName, context).block(); } /** @@ -632,16 +638,14 @@ public DatastoreInner getByResourceGroup(String resourceGroupName, String datast * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the datastore along with {@link Response}. + * @return define the datastore. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String datastoreName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, datastoreName, context).block(); + public DatastoreInner getByResourceGroup(String resourceGroupName, String datastoreName) { + return getByResourceGroupWithResponse(resourceGroupName, datastoreName, Context.NONE).getValue(); } /** @@ -759,14 +763,14 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. - * @param body Resource properties to update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the datastore on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String datastoreName, ResourcePatch body) { + private Mono updateAsync(String resourceGroupName, String datastoreName) { + final ResourcePatch body = null; return updateWithResponseAsync(resourceGroupName, datastoreName, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -778,16 +782,17 @@ private Mono updateAsync(String resourceGroupName, String datast * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. + * @param body Resource properties to update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the datastore on successful completion of {@link Mono}. + * @return define the datastore along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String datastoreName) { - final ResourcePatch body = null; - return updateWithResponseAsync(resourceGroupName, datastoreName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response updateWithResponse( + String resourceGroupName, String datastoreName, ResourcePatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, datastoreName, body, context).block(); } /** @@ -805,27 +810,7 @@ private Mono updateAsync(String resourceGroupName, String datast @ServiceMethod(returns = ReturnType.SINGLE) public DatastoreInner update(String resourceGroupName, String datastoreName) { final ResourcePatch body = null; - return updateAsync(resourceGroupName, datastoreName, body).block(); - } - - /** - * Updates a datastore. - * - *

API to update certain properties of the datastore resource. - * - * @param resourceGroupName The Resource Group Name. - * @param datastoreName Name of the datastore. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the datastore along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String datastoreName, ResourcePatch body, Context context) { - return updateWithResponseAsync(resourceGroupName, datastoreName, body, context).block(); + return updateWithResponse(resourceGroupName, datastoreName, body, Context.NONE).getValue(); } /** @@ -953,6 +938,28 @@ private PollerFlux, Void> beginDeleteAsync( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } + /** + * Deletes an datastore. + * + *

Implements datastore DELETE method. + * + * @param resourceGroupName The Resource Group Name. + * @param datastoreName Name of the datastore. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync(String resourceGroupName, String datastoreName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, datastoreName, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + /** * Deletes an datastore. * @@ -985,16 +992,15 @@ private PollerFlux, Void> beginDeleteAsync( * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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> beginDelete( - String resourceGroupName, String datastoreName, Boolean force) { - return beginDeleteAsync(resourceGroupName, datastoreName, force).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String datastoreName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, datastoreName, force).getSyncPoller(); } /** @@ -1014,7 +1020,7 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String datastoreName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, datastoreName, force, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, datastoreName, force, context).getSyncPoller(); } /** @@ -1078,23 +1084,6 @@ private Mono deleteAsync(String resourceGroupName, String datastoreName, B .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes an datastore. - * - *

Implements datastore DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param datastoreName Name of the datastore. - * @param force Whether force delete was specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 datastoreName, Boolean force) { - deleteAsync(resourceGroupName, datastoreName, force).block(); - } - /** * Deletes an datastore. * @@ -1460,7 +1449,8 @@ public PagedIterable listByResourceGroup(String resourceGroupNam /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1495,7 +1485,8 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1531,7 +1522,8 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1567,7 +1559,8 @@ private Mono> listByResourceGroupNextSinglePageAsy /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoresImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoresImpl.java index 3d0b0785914e..d5586f9f3825 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoresImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/DatastoresImpl.java @@ -27,15 +27,6 @@ public DatastoresImpl( this.serviceManager = serviceManager; } - public Datastore getByResourceGroup(String resourceGroupName, String datastoreName) { - DatastoreInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, datastoreName); - if (inner != null) { - return new DatastoreImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String datastoreName, Context context) { Response inner = @@ -51,8 +42,13 @@ public Response getByResourceGroupWithResponse( } } - public void delete(String resourceGroupName, String datastoreName, Boolean force) { - this.serviceClient().delete(resourceGroupName, datastoreName, force); + public Datastore getByResourceGroup(String resourceGroupName, String datastoreName) { + DatastoreInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, datastoreName); + if (inner != null) { + return new DatastoreImpl(inner, this.manager()); + } else { + return null; + } } public void delete(String resourceGroupName, String datastoreName) { diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentImpl.java index 20f8858b92e5..20597e9cd41b 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentImpl.java @@ -5,17 +5,17 @@ package com.azure.resourcemanager.connectedvmware.implementation; import com.azure.core.management.SystemData; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner; import com.azure.resourcemanager.connectedvmware.models.GuestAgent; import com.azure.resourcemanager.connectedvmware.models.GuestCredential; import com.azure.resourcemanager.connectedvmware.models.HttpProxyConfiguration; import com.azure.resourcemanager.connectedvmware.models.ProvisioningAction; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import java.util.Collections; import java.util.List; -public final class GuestAgentImpl implements GuestAgent, GuestAgent.Definition { +public final class GuestAgentImpl implements GuestAgent { private GuestAgentInner innerObject; private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; @@ -50,6 +50,10 @@ public GuestCredential credentials() { return this.innerModel().credentials(); } + public String privateLinkScopeResourceId() { + return this.innerModel().privateLinkScopeResourceId(); + } + public HttpProxyConfiguration httpProxyConfig() { return this.innerModel().httpProxyConfig(); } @@ -75,7 +79,7 @@ public List statuses() { } } - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -86,75 +90,4 @@ public GuestAgentInner innerModel() { private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { return this.serviceManager; } - - private String resourceGroupName; - - private String virtualMachineName; - - private String name; - - public GuestAgentImpl withExistingVirtualMachine(String resourceGroupName, String virtualMachineName) { - this.resourceGroupName = resourceGroupName; - this.virtualMachineName = virtualMachineName; - return this; - } - - public GuestAgent create() { - this.innerObject = - serviceManager - .serviceClient() - .getGuestAgents() - .create(resourceGroupName, virtualMachineName, name, this.innerModel(), Context.NONE); - return this; - } - - public GuestAgent create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getGuestAgents() - .create(resourceGroupName, virtualMachineName, name, this.innerModel(), context); - return this; - } - - GuestAgentImpl(String name, com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerObject = new GuestAgentInner(); - this.serviceManager = serviceManager; - this.name = name; - } - - public GuestAgent refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getGuestAgents() - .getWithResponse(resourceGroupName, virtualMachineName, name, Context.NONE) - .getValue(); - return this; - } - - public GuestAgent refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getGuestAgents() - .getWithResponse(resourceGroupName, virtualMachineName, name, context) - .getValue(); - return this; - } - - public GuestAgentImpl withCredentials(GuestCredential credentials) { - this.innerModel().withCredentials(credentials); - return this; - } - - public GuestAgentImpl withHttpProxyConfig(HttpProxyConfiguration httpProxyConfig) { - this.innerModel().withHttpProxyConfig(httpProxyConfig); - return this; - } - - public GuestAgentImpl withProvisioningAction(ProvisioningAction provisioningAction) { - this.innerModel().withProvisioningAction(provisioningAction); - return this; - } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentsImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentsImpl.java deleted file mode 100644 index 184d86baee28..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentsImpl.java +++ /dev/null @@ -1,193 +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.connectedvmware.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.connectedvmware.fluent.GuestAgentsClient; -import com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner; -import com.azure.resourcemanager.connectedvmware.models.GuestAgent; -import com.azure.resourcemanager.connectedvmware.models.GuestAgents; - -public final class GuestAgentsImpl implements GuestAgents { - private static final ClientLogger LOGGER = new ClientLogger(GuestAgentsImpl.class); - - private final GuestAgentsClient innerClient; - - private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; - - public GuestAgentsImpl( - GuestAgentsClient innerClient, - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public GuestAgent get(String resourceGroupName, String virtualMachineName, String name) { - GuestAgentInner inner = this.serviceClient().get(resourceGroupName, virtualMachineName, name); - if (inner != null) { - return new GuestAgentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String virtualMachineName, String name, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, virtualMachineName, name, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GuestAgentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String virtualMachineName, String name) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, name); - } - - public void delete(String resourceGroupName, String virtualMachineName, String name, Context context) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, name, context); - } - - public PagedIterable listByVm(String resourceGroupName, String virtualMachineName) { - PagedIterable inner = this.serviceClient().listByVm(resourceGroupName, virtualMachineName); - return Utils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); - } - - public PagedIterable listByVm(String resourceGroupName, String virtualMachineName, Context context) { - PagedIterable inner = - this.serviceClient().listByVm(resourceGroupName, virtualMachineName, context); - return Utils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); - } - - public GuestAgent 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String name = Utils.getValueFromIdByName(id, "guestAgents"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'guestAgents'.", id))); - } - return this.getWithResponse(resourceGroupName, virtualMachineName, name, 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String name = Utils.getValueFromIdByName(id, "guestAgents"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'guestAgents'.", id))); - } - return this.getWithResponse(resourceGroupName, virtualMachineName, name, 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String name = Utils.getValueFromIdByName(id, "guestAgents"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'guestAgents'.", id))); - } - this.delete(resourceGroupName, virtualMachineName, name, Context.NONE); - } - - public void 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String name = Utils.getValueFromIdByName(id, "guestAgents"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'guestAgents'.", id))); - } - this.delete(resourceGroupName, virtualMachineName, name, context); - } - - private GuestAgentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { - return this.serviceManager; - } - - public GuestAgentImpl define(String name) { - return new GuestAgentImpl(name, this.manager()); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostModelImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostModelImpl.java index 102fb77fcc07..a0424d42d62d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostModelImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostModelImpl.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.connectedvmware.fluent.models.HostModelInner; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; import com.azure.resourcemanager.connectedvmware.models.HostModel; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourcePatch; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import java.util.Collections; @@ -91,7 +92,41 @@ public String customResourceName() { return this.innerModel().customResourceName(); } - public String provisioningState() { + public Long overallMemoryUsageGB() { + return this.innerModel().overallMemoryUsageGB(); + } + + public Long memorySizeGB() { + return this.innerModel().memorySizeGB(); + } + + public Long overallCpuUsageMHz() { + return this.innerModel().overallCpuUsageMHz(); + } + + public Long cpuMhz() { + return this.innerModel().cpuMhz(); + } + + public List datastoreIds() { + List inner = this.innerModel().datastoreIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List networkIds() { + List inner = this.innerModel().networkIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostsClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostsClientImpl.java index c18adb2f6a33..d64575d54c50 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostsClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostsClientImpl.java @@ -64,11 +64,10 @@ public final class HostsClientImpl implements HostsClient { */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface HostsService { + public interface HostsService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -83,8 +82,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -98,8 +96,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -114,8 +111,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -141,8 +137,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/hosts") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -309,6 +304,33 @@ private PollerFlux, HostModelInner> beginCreateAsync( this.client.getContext()); } + /** + * Implements host PUT method. + * + *

Create Or Update host. + * + * @param resourceGroupName The Resource Group Name. + * @param hostname Name of the host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HostModelInner> beginCreateAsync( + String resourceGroupName, String hostname) { + final HostModelInner body = null; + Mono>> mono = createWithResponseAsync(resourceGroupName, hostname, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + HostModelInner.class, + HostModelInner.class, + this.client.getContext()); + } + /** * Implements host PUT method. * @@ -341,7 +363,6 @@ private PollerFlux, HostModelInner> beginCreateAsync( * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -349,8 +370,9 @@ private PollerFlux, HostModelInner> beginCreateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, HostModelInner> beginCreate( - String resourceGroupName, String hostname, HostModelInner body) { - return beginCreateAsync(resourceGroupName, hostname, body).getSyncPoller(); + String resourceGroupName, String hostname) { + final HostModelInner body = null; + return this.beginCreateAsync(resourceGroupName, hostname, body).getSyncPoller(); } /** @@ -370,7 +392,7 @@ public SyncPoller, HostModelInner> beginCreate( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, HostModelInner> beginCreate( String resourceGroupName, String hostname, HostModelInner body, Context context) { - return beginCreateAsync(resourceGroupName, hostname, body, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, hostname, body, context).getSyncPoller(); } /** @@ -435,24 +457,6 @@ private Mono createAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Implements host PUT method. - * - *

Create Or Update host. - * - * @param resourceGroupName The Resource Group Name. - * @param hostname Name of the host. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HostModelInner create(String resourceGroupName, String hostname, HostModelInner body) { - return createAsync(resourceGroupName, hostname, body).block(); - } - /** * Implements host PUT method. * @@ -613,14 +617,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, S * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the host. + * @return define the host along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public HostModelInner getByResourceGroup(String resourceGroupName, String hostname) { - return getByResourceGroupAsync(resourceGroupName, hostname).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String hostname, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, hostname, context).block(); } /** @@ -630,16 +636,14 @@ public HostModelInner getByResourceGroup(String resourceGroupName, String hostna * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the host along with {@link Response}. + * @return define the host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String hostname, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, hostname, context).block(); + public HostModelInner getByResourceGroup(String resourceGroupName, String hostname) { + return getByResourceGroupWithResponse(resourceGroupName, hostname, Context.NONE).getValue(); } /** @@ -757,14 +761,14 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. - * @param body Resource properties to update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the host on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String hostname, ResourcePatch body) { + private Mono updateAsync(String resourceGroupName, String hostname) { + final ResourcePatch body = null; return updateWithResponseAsync(resourceGroupName, hostname, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -776,16 +780,17 @@ private Mono updateAsync(String resourceGroupName, String hostna * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. + * @param body Resource properties to update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the host on successful completion of {@link Mono}. + * @return define the host along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String hostname) { - final ResourcePatch body = null; - return updateWithResponseAsync(resourceGroupName, hostname, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response updateWithResponse( + String resourceGroupName, String hostname, ResourcePatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, hostname, body, context).block(); } /** @@ -803,27 +808,7 @@ private Mono updateAsync(String resourceGroupName, String hostna @ServiceMethod(returns = ReturnType.SINGLE) public HostModelInner update(String resourceGroupName, String hostname) { final ResourcePatch body = null; - return updateAsync(resourceGroupName, hostname, body).block(); - } - - /** - * Updates a host. - * - *

API to update certain properties of the host resource. - * - * @param resourceGroupName The Resource Group Name. - * @param hostname Name of the host. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the host along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String hostname, ResourcePatch body, Context context) { - return updateWithResponseAsync(resourceGroupName, hostname, body, context).block(); + return updateWithResponse(resourceGroupName, hostname, body, Context.NONE).getValue(); } /** @@ -951,6 +936,28 @@ private PollerFlux, Void> beginDeleteAsync( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } + /** + * Deletes an host. + * + *

Implements host DELETE method. + * + * @param resourceGroupName The Resource Group Name. + * @param hostname Name of the host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync(String resourceGroupName, String hostname) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, hostname, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + /** * Deletes an host. * @@ -982,15 +989,15 @@ private PollerFlux, Void> beginDeleteAsync( * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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> beginDelete(String resourceGroupName, String hostname, Boolean force) { - return beginDeleteAsync(resourceGroupName, hostname, force).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String hostname) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, hostname, force).getSyncPoller(); } /** @@ -1010,7 +1017,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String hostname, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, hostname, force, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, hostname, force, context).getSyncPoller(); } /** @@ -1074,23 +1081,6 @@ private Mono deleteAsync(String resourceGroupName, String hostname, Boolea .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes an host. - * - *

Implements host DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param hostname Name of the host. - * @param force Whether force delete was specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 hostname, Boolean force) { - deleteAsync(resourceGroupName, hostname, force).block(); - } - /** * Deletes an host. * @@ -1456,7 +1446,8 @@ public PagedIterable listByResourceGroup(String resourceGroupNam /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1491,7 +1482,8 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1527,7 +1519,8 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1563,7 +1556,8 @@ private Mono> listByResourceGroupNextSinglePageAsy /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostsImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostsImpl.java index d73825ddd5f1..61408e2524dc 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostsImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HostsImpl.java @@ -27,15 +27,6 @@ public HostsImpl( this.serviceManager = serviceManager; } - public HostModel getByResourceGroup(String resourceGroupName, String hostname) { - HostModelInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, hostname); - if (inner != null) { - return new HostModelImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String hostname, Context context) { Response inner = @@ -51,8 +42,13 @@ public Response getByResourceGroupWithResponse( } } - public void delete(String resourceGroupName, String hostname, Boolean force) { - this.serviceClient().delete(resourceGroupName, hostname, force); + public HostModel getByResourceGroup(String resourceGroupName, String hostname) { + HostModelInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, hostname); + if (inner != null) { + return new HostModelImpl(inner, this.manager()); + } else { + return null; + } } public void delete(String resourceGroupName, String hostname) { diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HybridIdentityMetadataImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HybridIdentityMetadataImpl.java deleted file mode 100644 index f9540b624499..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HybridIdentityMetadataImpl.java +++ /dev/null @@ -1,134 +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.connectedvmware.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.fluent.models.HybridIdentityMetadataInner; -import com.azure.resourcemanager.connectedvmware.models.HybridIdentityMetadata; -import com.azure.resourcemanager.connectedvmware.models.Identity; - -public final class HybridIdentityMetadataImpl implements HybridIdentityMetadata, HybridIdentityMetadata.Definition { - private HybridIdentityMetadataInner innerObject; - - private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; - - HybridIdentityMetadataImpl( - HybridIdentityMetadataInner innerObject, - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String vmId() { - return this.innerModel().vmId(); - } - - public String publicKey() { - return this.innerModel().publicKey(); - } - - public Identity identity() { - return this.innerModel().identity(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public HybridIdentityMetadataInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String virtualMachineName; - - private String metadataName; - - public HybridIdentityMetadataImpl withExistingVirtualMachine(String resourceGroupName, String virtualMachineName) { - this.resourceGroupName = resourceGroupName; - this.virtualMachineName = virtualMachineName; - return this; - } - - public HybridIdentityMetadata create() { - this.innerObject = - serviceManager - .serviceClient() - .getHybridIdentityMetadatas() - .createWithResponse( - resourceGroupName, virtualMachineName, metadataName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public HybridIdentityMetadata create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getHybridIdentityMetadatas() - .createWithResponse(resourceGroupName, virtualMachineName, metadataName, this.innerModel(), context) - .getValue(); - return this; - } - - HybridIdentityMetadataImpl( - String name, com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerObject = new HybridIdentityMetadataInner(); - this.serviceManager = serviceManager; - this.metadataName = name; - } - - public HybridIdentityMetadata refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getHybridIdentityMetadatas() - .getWithResponse(resourceGroupName, virtualMachineName, metadataName, Context.NONE) - .getValue(); - return this; - } - - public HybridIdentityMetadata refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getHybridIdentityMetadatas() - .getWithResponse(resourceGroupName, virtualMachineName, metadataName, context) - .getValue(); - return this; - } - - public HybridIdentityMetadataImpl withVmId(String vmId) { - this.innerModel().withVmId(vmId); - return this; - } - - public HybridIdentityMetadataImpl withPublicKey(String publicKey) { - this.innerModel().withPublicKey(publicKey); - return this; - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HybridIdentityMetadatasClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HybridIdentityMetadatasClientImpl.java deleted file mode 100644 index ba52bd70cd1c..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HybridIdentityMetadatasClientImpl.java +++ /dev/null @@ -1,951 +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.connectedvmware.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.connectedvmware.fluent.HybridIdentityMetadatasClient; -import com.azure.resourcemanager.connectedvmware.fluent.models.HybridIdentityMetadataInner; -import com.azure.resourcemanager.connectedvmware.models.HybridIdentityMetadataList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in HybridIdentityMetadatasClient. */ -public final class HybridIdentityMetadatasClientImpl implements HybridIdentityMetadatasClient { - /** The proxy service used to perform REST calls. */ - private final HybridIdentityMetadatasService service; - - /** The service client containing this operation class. */ - private final ConnectedVMwareClientImpl client; - - /** - * Initializes an instance of HybridIdentityMetadatasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HybridIdentityMetadatasClientImpl(ConnectedVMwareClientImpl client) { - this.service = - RestProxy - .create(HybridIdentityMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ConnectedVMwareClientHybridIdentityMetadatas to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ConnectedVMwareClien") - private interface HybridIdentityMetadatasService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata" - + "/{metadataName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @PathParam("metadataName") String metadataName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HybridIdentityMetadataInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata" - + "/{metadataName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @PathParam("metadataName") String metadataName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata" - + "/{metadataName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @PathParam("metadataName") String metadataName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVm( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVmNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Implements HybridIdentityMetadata PUT method. - * - *

Create Or Update HybridIdentityMetadata. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the hybridIdentityMetadata. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String virtualMachineName, String metadataName, HybridIdentityMetadataInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (metadataName == null) { - return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - metadataName, - this.client.getApiVersion(), - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Implements HybridIdentityMetadata PUT method. - * - *

Create Or Update HybridIdentityMetadata. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the hybridIdentityMetadata. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String virtualMachineName, - String metadataName, - HybridIdentityMetadataInner body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (metadataName == null) { - return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - metadataName, - this.client.getApiVersion(), - body, - accept, - context); - } - - /** - * Implements HybridIdentityMetadata PUT method. - * - *

Create Or Update HybridIdentityMetadata. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the hybridIdentityMetadata. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String virtualMachineName, String metadataName, HybridIdentityMetadataInner body) { - return createWithResponseAsync(resourceGroupName, virtualMachineName, metadataName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Implements HybridIdentityMetadata PUT method. - * - *

Create Or Update HybridIdentityMetadata. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the hybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String virtualMachineName, String metadataName) { - final HybridIdentityMetadataInner body = null; - return createWithResponseAsync(resourceGroupName, virtualMachineName, metadataName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Implements HybridIdentityMetadata PUT method. - * - *

Create Or Update HybridIdentityMetadata. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the hybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridIdentityMetadataInner create( - String resourceGroupName, String virtualMachineName, String metadataName) { - final HybridIdentityMetadataInner body = null; - return createAsync(resourceGroupName, virtualMachineName, metadataName, body).block(); - } - - /** - * Implements HybridIdentityMetadata PUT method. - * - *

Create Or Update HybridIdentityMetadata. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the hybridIdentityMetadata. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String virtualMachineName, - String metadataName, - HybridIdentityMetadataInner body, - Context context) { - return createWithResponseAsync(resourceGroupName, virtualMachineName, metadataName, body, context).block(); - } - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String virtualMachineName, String metadataName) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (metadataName == null) { - return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - metadataName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String virtualMachineName, String metadataName, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (metadataName == null) { - return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - metadataName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String virtualMachineName, String metadataName) { - return getWithResponseAsync(resourceGroupName, virtualMachineName, metadataName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridIdentityMetadataInner get(String resourceGroupName, String virtualMachineName, String metadataName) { - return getAsync(resourceGroupName, virtualMachineName, metadataName).block(); - } - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String virtualMachineName, String metadataName, Context context) { - return getWithResponseAsync(resourceGroupName, virtualMachineName, metadataName, context).block(); - } - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, String metadataName) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (metadataName == null) { - return Mono.error(new IllegalArgumentException("Parameter metadataName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - metadataName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, String metadataName, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (metadataName == null) { - return Mono.error(new IllegalArgumentException("Parameter metadataName 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, - virtualMachineName, - metadataName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 virtualMachineName, String metadataName) { - return deleteWithResponseAsync(resourceGroupName, virtualMachineName, metadataName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 virtualMachineName, String metadataName) { - deleteAsync(resourceGroupName, virtualMachineName, metadataName).block(); - } - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, String metadataName, Context context) { - return deleteWithResponseAsync(resourceGroupName, virtualMachineName, metadataName, context).block(); - } - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmSinglePageAsync( - String resourceGroupName, String virtualMachineName) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByVm( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - 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())); - } - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmSinglePageAsync( - String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByVm( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 HybridIdentityMetadata as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVmAsync(String resourceGroupName, String virtualMachineName) { - return new PagedFlux<>( - () -> listByVmSinglePageAsync(resourceGroupName, virtualMachineName), - nextLink -> listByVmNextSinglePageAsync(nextLink)); - } - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 HybridIdentityMetadata as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVmAsync( - String resourceGroupName, String virtualMachineName, Context context) { - return new PagedFlux<>( - () -> listByVmSinglePageAsync(resourceGroupName, virtualMachineName, context), - nextLink -> listByVmNextSinglePageAsync(nextLink, context)); - } - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVm(String resourceGroupName, String virtualMachineName) { - return new PagedIterable<>(listByVmAsync(resourceGroupName, virtualMachineName)); - } - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVm( - String resourceGroupName, String virtualMachineName, Context context) { - return new PagedIterable<>(listByVmAsync(resourceGroupName, virtualMachineName, 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 HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmNextSinglePageAsync(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.listByVmNext(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 HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmNextSinglePageAsync( - 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 - .listByVmNext(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/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HybridIdentityMetadatasImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HybridIdentityMetadatasImpl.java deleted file mode 100644 index f8ac50d26d98..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/HybridIdentityMetadatasImpl.java +++ /dev/null @@ -1,209 +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.connectedvmware.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.connectedvmware.fluent.HybridIdentityMetadatasClient; -import com.azure.resourcemanager.connectedvmware.fluent.models.HybridIdentityMetadataInner; -import com.azure.resourcemanager.connectedvmware.models.HybridIdentityMetadata; -import com.azure.resourcemanager.connectedvmware.models.HybridIdentityMetadatas; - -public final class HybridIdentityMetadatasImpl implements HybridIdentityMetadatas { - private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadatasImpl.class); - - private final HybridIdentityMetadatasClient innerClient; - - private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; - - public HybridIdentityMetadatasImpl( - HybridIdentityMetadatasClient innerClient, - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public HybridIdentityMetadata get(String resourceGroupName, String virtualMachineName, String metadataName) { - HybridIdentityMetadataInner inner = - this.serviceClient().get(resourceGroupName, virtualMachineName, metadataName); - if (inner != null) { - return new HybridIdentityMetadataImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String virtualMachineName, String metadataName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, virtualMachineName, metadataName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new HybridIdentityMetadataImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String virtualMachineName, String metadataName) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, metadataName); - } - - public Response deleteWithResponse( - String resourceGroupName, String virtualMachineName, String metadataName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, virtualMachineName, metadataName, context); - } - - public PagedIterable listByVm(String resourceGroupName, String virtualMachineName) { - PagedIterable inner = - this.serviceClient().listByVm(resourceGroupName, virtualMachineName); - return Utils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); - } - - public PagedIterable listByVm( - String resourceGroupName, String virtualMachineName, Context context) { - PagedIterable inner = - this.serviceClient().listByVm(resourceGroupName, virtualMachineName, context); - return Utils.mapPage(inner, inner1 -> new HybridIdentityMetadataImpl(inner1, this.manager())); - } - - public HybridIdentityMetadata 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String metadataName = Utils.getValueFromIdByName(id, "hybridIdentityMetadata"); - if (metadataName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'hybridIdentityMetadata'.", - id))); - } - return this.getWithResponse(resourceGroupName, virtualMachineName, metadataName, 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String metadataName = Utils.getValueFromIdByName(id, "hybridIdentityMetadata"); - if (metadataName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'hybridIdentityMetadata'.", - id))); - } - return this.getWithResponse(resourceGroupName, virtualMachineName, metadataName, 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String metadataName = Utils.getValueFromIdByName(id, "hybridIdentityMetadata"); - if (metadataName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'hybridIdentityMetadata'.", - id))); - } - this.deleteWithResponse(resourceGroupName, virtualMachineName, metadataName, 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String metadataName = Utils.getValueFromIdByName(id, "hybridIdentityMetadata"); - if (metadataName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'hybridIdentityMetadata'.", - id))); - } - return this.deleteWithResponse(resourceGroupName, virtualMachineName, metadataName, context); - } - - private HybridIdentityMetadatasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { - return this.serviceManager; - } - - public HybridIdentityMetadataImpl define(String name) { - return new HybridIdentityMetadataImpl(name, this.manager()); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemImpl.java index 3fec82cbb353..6dca91524c62 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemImpl.java @@ -8,6 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemInner; import com.azure.resourcemanager.connectedvmware.models.InventoryItem; +import com.azure.resourcemanager.connectedvmware.models.InventoryItemProperties; public final class InventoryItemImpl implements InventoryItem, InventoryItem.Definition { private InventoryItemInner innerObject; @@ -33,28 +34,16 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public InventoryItemProperties properties() { + return this.innerModel().properties(); } public String kind() { return this.innerModel().kind(); } - public String managedResourceId() { - return this.innerModel().managedResourceId(); - } - - public String moRefId() { - return this.innerModel().moRefId(); - } - - public String moName() { - return this.innerModel().moName(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public InventoryItemInner innerModel() { @@ -123,23 +112,13 @@ public InventoryItem refresh(Context context) { return this; } - public InventoryItemImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public InventoryItemImpl withManagedResourceId(String managedResourceId) { - this.innerModel().withManagedResourceId(managedResourceId); + public InventoryItemImpl withProperties(InventoryItemProperties properties) { + this.innerModel().withProperties(properties); return this; } - public InventoryItemImpl withMoRefId(String moRefId) { - this.innerModel().withMoRefId(moRefId); - return this; - } - - public InventoryItemImpl withMoName(String moName) { - this.innerModel().withMoName(moName); + public InventoryItemImpl withKind(String kind) { + this.innerModel().withKind(kind); return this; } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemsClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemsClientImpl.java index d2008f8ceef7..f258f4827b69 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemsClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemsClientImpl.java @@ -58,11 +58,10 @@ public final class InventoryItemsClientImpl implements InventoryItemsClient { */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface InventoryItemsService { + public interface InventoryItemsService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> create( @@ -78,8 +77,7 @@ Mono> create( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -94,8 +92,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -110,8 +107,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByVCenter( @@ -266,7 +262,6 @@ private Mono> createWithResponseAsync( * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -274,7 +269,8 @@ private Mono> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( - String resourceGroupName, String vcenterName, String inventoryItemName, InventoryItemInner body) { + String resourceGroupName, String vcenterName, String inventoryItemName) { + final InventoryItemInner body = null; return createWithResponseAsync(resourceGroupName, vcenterName, inventoryItemName, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -287,17 +283,21 @@ private Mono createAsync( * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. + * @param body Request payload. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item on successful completion of {@link Mono}. + * @return defines the inventory item along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String vcenterName, String inventoryItemName) { - final InventoryItemInner body = null; - return createWithResponseAsync(resourceGroupName, vcenterName, inventoryItemName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response createWithResponse( + String resourceGroupName, + String vcenterName, + String inventoryItemName, + InventoryItemInner body, + Context context) { + return createWithResponseAsync(resourceGroupName, vcenterName, inventoryItemName, body, context).block(); } /** @@ -316,32 +316,7 @@ private Mono createAsync( @ServiceMethod(returns = ReturnType.SINGLE) public InventoryItemInner create(String resourceGroupName, String vcenterName, String inventoryItemName) { final InventoryItemInner body = null; - return createAsync(resourceGroupName, vcenterName, inventoryItemName, body).block(); - } - - /** - * Implements InventoryItem PUT method. - * - *

Create Or Update InventoryItem. - * - * @param resourceGroupName The Resource Group Name. - * @param vcenterName Name of the vCenter. - * @param inventoryItemName Name of the inventoryItem. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String vcenterName, - String inventoryItemName, - InventoryItemInner body, - Context context) { - return createWithResponseAsync(resourceGroupName, vcenterName, inventoryItemName, body, context).block(); + return createWithResponse(resourceGroupName, vcenterName, inventoryItemName, body, Context.NONE).getValue(); } /** @@ -481,14 +456,16 @@ private Mono getAsync(String resourceGroupName, String vcent * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item. + * @return defines the inventory item along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public InventoryItemInner get(String resourceGroupName, String vcenterName, String inventoryItemName) { - return getAsync(resourceGroupName, vcenterName, inventoryItemName).block(); + public Response getWithResponse( + String resourceGroupName, String vcenterName, String inventoryItemName, Context context) { + return getWithResponseAsync(resourceGroupName, vcenterName, inventoryItemName, context).block(); } /** @@ -499,16 +476,14 @@ public InventoryItemInner get(String resourceGroupName, String vcenterName, Stri * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item along with {@link Response}. + * @return defines the inventory item. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vcenterName, String inventoryItemName, Context context) { - return getWithResponseAsync(resourceGroupName, vcenterName, inventoryItemName, context).block(); + public InventoryItemInner get(String resourceGroupName, String vcenterName, String inventoryItemName) { + return getWithResponse(resourceGroupName, vcenterName, inventoryItemName, Context.NONE).getValue(); } /** @@ -648,13 +623,16 @@ private Mono deleteAsync(String resourceGroupName, String vcenterName, Str * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vcenterName, String inventoryItemName) { - deleteAsync(resourceGroupName, vcenterName, inventoryItemName).block(); + public Response deleteWithResponse( + String resourceGroupName, String vcenterName, String inventoryItemName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vcenterName, inventoryItemName, context).block(); } /** @@ -665,16 +643,13 @@ public void delete(String resourceGroupName, String vcenterName, String inventor * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 vcenterName, String inventoryItemName, Context context) { - return deleteWithResponseAsync(resourceGroupName, vcenterName, inventoryItemName, context).block(); + public void delete(String resourceGroupName, String vcenterName, String inventoryItemName) { + deleteWithResponse(resourceGroupName, vcenterName, inventoryItemName, Context.NONE); } /** @@ -872,7 +847,8 @@ public PagedIterable listByVCenter( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -907,7 +883,8 @@ private Mono> listByVCenterNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemsImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemsImpl.java index b25bd7d6fea4..e7a3e17cbaa1 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemsImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/InventoryItemsImpl.java @@ -28,15 +28,6 @@ public InventoryItemsImpl( this.serviceManager = serviceManager; } - public InventoryItem get(String resourceGroupName, String vcenterName, String inventoryItemName) { - InventoryItemInner inner = this.serviceClient().get(resourceGroupName, vcenterName, inventoryItemName); - if (inner != null) { - return new InventoryItemImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String vcenterName, String inventoryItemName, Context context) { Response inner = @@ -52,8 +43,13 @@ public Response getWithResponse( } } - public void delete(String resourceGroupName, String vcenterName, String inventoryItemName) { - this.serviceClient().delete(resourceGroupName, vcenterName, inventoryItemName); + public InventoryItem get(String resourceGroupName, String vcenterName, String inventoryItemName) { + InventoryItemInner inner = this.serviceClient().get(resourceGroupName, vcenterName, inventoryItemName); + if (inner != null) { + return new InventoryItemImpl(inner, this.manager()); + } else { + return null; + } } public Response deleteWithResponse( @@ -61,6 +57,10 @@ public Response deleteWithResponse( return this.serviceClient().deleteWithResponse(resourceGroupName, vcenterName, inventoryItemName, context); } + public void delete(String resourceGroupName, String vcenterName, String inventoryItemName) { + this.serviceClient().delete(resourceGroupName, vcenterName, inventoryItemName); + } + public PagedIterable listByVCenter(String resourceGroupName, String vcenterName) { PagedIterable inner = this.serviceClient().listByVCenter(resourceGroupName, vcenterName); return Utils.mapPage(inner, inner1 -> new InventoryItemImpl(inner1, this.manager())); diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/MachineExtensionImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/MachineExtensionImpl.java deleted file mode 100644 index 50f5e15cae35..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/MachineExtensionImpl.java +++ /dev/null @@ -1,311 +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.connectedvmware.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.fluent.models.MachineExtensionInner; -import com.azure.resourcemanager.connectedvmware.models.MachineExtension; -import com.azure.resourcemanager.connectedvmware.models.MachineExtensionPropertiesInstanceView; -import com.azure.resourcemanager.connectedvmware.models.MachineExtensionUpdate; -import java.util.Collections; -import java.util.Map; - -public final class MachineExtensionImpl - implements MachineExtension, MachineExtension.Definition, MachineExtension.Update { - private MachineExtensionInner innerObject; - - private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager 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 String forceUpdateTag() { - return this.innerModel().forceUpdateTag(); - } - - public String publisher() { - return this.innerModel().publisher(); - } - - public String typePropertiesType() { - return this.innerModel().typePropertiesType(); - } - - public String typeHandlerVersion() { - return this.innerModel().typeHandlerVersion(); - } - - public Boolean enableAutomaticUpgrade() { - return this.innerModel().enableAutomaticUpgrade(); - } - - public Boolean autoUpgradeMinorVersion() { - return this.innerModel().autoUpgradeMinorVersion(); - } - - public Object settings() { - return this.innerModel().settings(); - } - - public Object protectedSettings() { - return this.innerModel().protectedSettings(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public MachineExtensionPropertiesInstanceView instanceView() { - return this.innerModel().instanceView(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public MachineExtensionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String name; - - private String extensionName; - - private MachineExtensionUpdate updateExtensionParameters; - - public MachineExtensionImpl withExistingVirtualMachine(String resourceGroupName, String name) { - this.resourceGroupName = resourceGroupName; - this.name = name; - return this; - } - - public MachineExtension create() { - this.innerObject = - serviceManager - .serviceClient() - .getMachineExtensions() - .createOrUpdate(resourceGroupName, name, extensionName, this.innerModel(), Context.NONE); - return this; - } - - public MachineExtension create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMachineExtensions() - .createOrUpdate(resourceGroupName, name, extensionName, this.innerModel(), context); - return this; - } - - MachineExtensionImpl(String name, com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerObject = new MachineExtensionInner(); - this.serviceManager = serviceManager; - this.extensionName = name; - } - - public MachineExtensionImpl update() { - this.updateExtensionParameters = new MachineExtensionUpdate(); - return this; - } - - public MachineExtension apply() { - this.innerObject = - serviceManager - .serviceClient() - .getMachineExtensions() - .update(resourceGroupName, name, extensionName, updateExtensionParameters, Context.NONE); - return this; - } - - public MachineExtension apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMachineExtensions() - .update(resourceGroupName, name, extensionName, updateExtensionParameters, context); - return this; - } - - MachineExtensionImpl( - MachineExtensionInner innerObject, - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); - this.extensionName = Utils.getValueFromIdByName(innerObject.id(), "extensions"); - } - - public MachineExtension refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getMachineExtensions() - .getWithResponse(resourceGroupName, name, extensionName, Context.NONE) - .getValue(); - return this; - } - - public MachineExtension refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMachineExtensions() - .getWithResponse(resourceGroupName, name, extensionName, context) - .getValue(); - return this; - } - - public MachineExtensionImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public MachineExtensionImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public MachineExtensionImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateExtensionParameters.withTags(tags); - return this; - } - } - - public MachineExtensionImpl withForceUpdateTag(String forceUpdateTag) { - if (isInCreateMode()) { - this.innerModel().withForceUpdateTag(forceUpdateTag); - return this; - } else { - this.updateExtensionParameters.withForceUpdateTag(forceUpdateTag); - return this; - } - } - - public MachineExtensionImpl withPublisher(String publisher) { - if (isInCreateMode()) { - this.innerModel().withPublisher(publisher); - return this; - } else { - this.updateExtensionParameters.withPublisher(publisher); - return this; - } - } - - public MachineExtensionImpl withTypePropertiesType(String typePropertiesType) { - this.innerModel().withTypePropertiesType(typePropertiesType); - return this; - } - - public MachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { - if (isInCreateMode()) { - this.innerModel().withTypeHandlerVersion(typeHandlerVersion); - return this; - } else { - this.updateExtensionParameters.withTypeHandlerVersion(typeHandlerVersion); - return this; - } - } - - public MachineExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - if (isInCreateMode()) { - this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } else { - this.updateExtensionParameters.withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } - } - - public MachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (isInCreateMode()) { - this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } else { - this.updateExtensionParameters.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - } - - public MachineExtensionImpl withSettings(Object settings) { - if (isInCreateMode()) { - this.innerModel().withSettings(settings); - return this; - } else { - this.updateExtensionParameters.withSettings(settings); - return this; - } - } - - public MachineExtensionImpl withProtectedSettings(Object protectedSettings) { - if (isInCreateMode()) { - this.innerModel().withProtectedSettings(protectedSettings); - return this; - } else { - this.updateExtensionParameters.withProtectedSettings(protectedSettings); - return this; - } - } - - public MachineExtensionImpl withInstanceView(MachineExtensionPropertiesInstanceView instanceView) { - this.innerModel().withInstanceView(instanceView); - return this; - } - - public MachineExtensionImpl withType(String type) { - this.updateExtensionParameters.withType(type); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/MachineExtensionsClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/MachineExtensionsClientImpl.java deleted file mode 100644 index 5b123075add3..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/MachineExtensionsClientImpl.java +++ /dev/null @@ -1,1460 +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.connectedvmware.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.connectedvmware.fluent.MachineExtensionsClient; -import com.azure.resourcemanager.connectedvmware.fluent.models.MachineExtensionInner; -import com.azure.resourcemanager.connectedvmware.models.MachineExtensionUpdate; -import com.azure.resourcemanager.connectedvmware.models.MachineExtensionsListResult; -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 MachineExtensionsClient. */ -public final class MachineExtensionsClientImpl implements MachineExtensionsClient { - /** The proxy service used to perform REST calls. */ - private final MachineExtensionsService service; - - /** The service client containing this operation class. */ - private final ConnectedVMwareClientImpl client; - - /** - * Initializes an instance of MachineExtensionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MachineExtensionsClientImpl(ConnectedVMwareClientImpl client) { - this.service = - RestProxy.create(MachineExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ConnectedVMwareClientMachineExtensions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ConnectedVMwareClien") - private interface MachineExtensionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, - @PathParam("extensionName") String extensionName, - @BodyParam("application/json") MachineExtensionInner extensionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, - @PathParam("extensionName") String extensionName, - @BodyParam("application/json") MachineExtensionUpdate extensionParameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, - @PathParam("extensionName") String extensionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, - @PathParam("extensionName") String extensionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - name, - extensionName, - extensionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionInner extensionParameters, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - name, - extensionName, - extensionParameters, - accept, - context); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MachineExtensionInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, extensionName, extensionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - MachineExtensionInner.class, - MachineExtensionInner.class, - this.client.getContext()); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MachineExtensionInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionInner extensionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, extensionName, extensionParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), MachineExtensionInner.class, MachineExtensionInner.class, context); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MachineExtensionInner> beginCreateOrUpdate( - String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, name, extensionName, extensionParameters).getSyncPoller(); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MachineExtensionInner> beginCreateOrUpdate( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, extensionName, extensionParameters, context) - .getSyncPoller(); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, name, extensionName, extensionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, extensionName, extensionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MachineExtensionInner createOrUpdate( - String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { - return createOrUpdateAsync(resourceGroupName, name, extensionName, extensionParameters).block(); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MachineExtensionInner createOrUpdate( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionInner extensionParameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, name, extensionName, extensionParameters, context).block(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - name, - extensionName, - extensionParameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionUpdate extensionParameters, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - name, - extensionName, - extensionParameters, - accept, - context); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MachineExtensionInner> beginUpdateAsync( - String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, name, extensionName, extensionParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - MachineExtensionInner.class, - MachineExtensionInner.class, - this.client.getContext()); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MachineExtensionInner> beginUpdateAsync( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionUpdate extensionParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, name, extensionName, extensionParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), MachineExtensionInner.class, MachineExtensionInner.class, context); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MachineExtensionInner> beginUpdate( - String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { - return beginUpdateAsync(resourceGroupName, name, extensionName, extensionParameters).getSyncPoller(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MachineExtensionInner> beginUpdate( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, name, extensionName, extensionParameters, context).getSyncPoller(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { - return beginUpdateAsync(resourceGroupName, name, extensionName, extensionParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, name, extensionName, extensionParameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MachineExtensionInner update( - String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { - return updateAsync(resourceGroupName, name, extensionName, extensionParameters).block(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @param extensionName The name of the machine extension. - * @param extensionParameters Parameters supplied to the Create Machine Extension operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MachineExtensionInner update( - String resourceGroupName, - String name, - String extensionName, - MachineExtensionUpdate extensionParameters, - Context context) { - return updateAsync(resourceGroupName, name, extensionName, extensionParameters, context).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 name, String extensionName) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - name, - extensionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String name, String extensionName, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName 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, - this.client.getApiVersion(), - name, - extensionName, - accept, - context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDeleteAsync( - String resourceGroupName, String name, String extensionName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, extensionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String name, String extensionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, name, extensionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDelete(String resourceGroupName, String name, String extensionName) { - return beginDeleteAsync(resourceGroupName, name, extensionName).getSyncPoller(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String name, String extensionName, Context context) { - return beginDeleteAsync(resourceGroupName, name, extensionName, context).getSyncPoller(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 name, String extensionName) { - return beginDeleteAsync(resourceGroupName, name, extensionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String name, String extensionName, Context context) { - return beginDeleteAsync(resourceGroupName, name, extensionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 name, String extensionName) { - deleteAsync(resourceGroupName, name, extensionName).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name, String extensionName, Context context) { - deleteAsync(resourceGroupName, name, extensionName, context).block(); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String name, String extensionName) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - name, - extensionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String name, String extensionName, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (extensionName == null) { - return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - name, - extensionName, - accept, - context); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String name, String extensionName) { - return getWithResponseAsync(resourceGroupName, name, extensionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MachineExtensionInner get(String resourceGroupName, String name, String extensionName) { - return getAsync(resourceGroupName, name, extensionName).block(); - } - - /** - * The operation to get the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String name, String extensionName, Context context) { - return getWithResponseAsync(resourceGroupName, name, extensionName, context).block(); - } - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String name, String expand) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - name, - expand, - 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())); - } - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String name, String expand, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - name, - expand, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String name, String expand) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, name, expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String name) { - final String expand = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, name, expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String name, String expand, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, name, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String name) { - final String expand = null; - return new PagedIterable<>(listAsync(resourceGroupName, name, expand)); - } - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String name, String expand, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, name, expand, 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 describes the Machine Extensions List Result along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/MachineExtensionsImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/MachineExtensionsImpl.java deleted file mode 100644 index 20c27aa1787f..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/MachineExtensionsImpl.java +++ /dev/null @@ -1,193 +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.connectedvmware.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.connectedvmware.fluent.MachineExtensionsClient; -import com.azure.resourcemanager.connectedvmware.fluent.models.MachineExtensionInner; -import com.azure.resourcemanager.connectedvmware.models.MachineExtension; -import com.azure.resourcemanager.connectedvmware.models.MachineExtensions; - -public final class MachineExtensionsImpl implements MachineExtensions { - private static final ClientLogger LOGGER = new ClientLogger(MachineExtensionsImpl.class); - - private final MachineExtensionsClient innerClient; - - private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; - - public MachineExtensionsImpl( - MachineExtensionsClient innerClient, - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void delete(String resourceGroupName, String name, String extensionName) { - this.serviceClient().delete(resourceGroupName, name, extensionName); - } - - public void delete(String resourceGroupName, String name, String extensionName, Context context) { - this.serviceClient().delete(resourceGroupName, name, extensionName, context); - } - - public MachineExtension get(String resourceGroupName, String name, String extensionName) { - MachineExtensionInner inner = this.serviceClient().get(resourceGroupName, name, extensionName); - if (inner != null) { - return new MachineExtensionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String name, String extensionName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, name, extensionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new MachineExtensionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String name) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, name); - return Utils.mapPage(inner, inner1 -> new MachineExtensionImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String name, String expand, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, name, expand, context); - return Utils.mapPage(inner, inner1 -> new MachineExtensionImpl(inner1, this.manager())); - } - - public MachineExtension 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 name = Utils.getValueFromIdByName(id, "virtualMachines"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String extensionName = Utils.getValueFromIdByName(id, "extensions"); - if (extensionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); - } - return this.getWithResponse(resourceGroupName, name, extensionName, 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 name = Utils.getValueFromIdByName(id, "virtualMachines"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String extensionName = Utils.getValueFromIdByName(id, "extensions"); - if (extensionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); - } - return this.getWithResponse(resourceGroupName, name, extensionName, 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 name = Utils.getValueFromIdByName(id, "virtualMachines"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String extensionName = Utils.getValueFromIdByName(id, "extensions"); - if (extensionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); - } - this.delete(resourceGroupName, name, extensionName, Context.NONE); - } - - public void 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 name = Utils.getValueFromIdByName(id, "virtualMachines"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - String extensionName = Utils.getValueFromIdByName(id, "extensions"); - if (extensionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); - } - this.delete(resourceGroupName, name, extensionName, context); - } - - private MachineExtensionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { - return this.serviceManager; - } - - public MachineExtensionImpl define(String name) { - return new MachineExtensionImpl(name, this.manager()); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/OperationsClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/OperationsClientImpl.java index 02d7603bb67c..f0a5f6fa65fa 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/OperationsClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/OperationsClientImpl.java @@ -55,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.ConnectedVMwarevSphere/operations") @ExpectedResponses({200}) @@ -196,7 +196,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -231,7 +232,8 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolImpl.java index 514c1540e8c7..ce8f86c79f62 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolImpl.java @@ -9,6 +9,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.fluent.models.ResourcePoolInner; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourcePatch; import com.azure.resourcemanager.connectedvmware.models.ResourcePool; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; @@ -102,10 +103,44 @@ public Long memLimitMB() { return this.innerModel().memLimitMB(); } + public Long memOverallUsageGB() { + return this.innerModel().memOverallUsageGB(); + } + + public Long memCapacityGB() { + return this.innerModel().memCapacityGB(); + } + + public Long cpuOverallUsageMHz() { + return this.innerModel().cpuOverallUsageMHz(); + } + + public Long cpuCapacityMHz() { + return this.innerModel().cpuCapacityMHz(); + } + public String customResourceName() { return this.innerModel().customResourceName(); } + public List datastoreIds() { + List inner = this.innerModel().datastoreIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List networkIds() { + List inner = this.innerModel().networkIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public List statuses() { List inner = this.innerModel().statuses(); if (inner != null) { @@ -115,7 +150,7 @@ public List statuses() { } } - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolsClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolsClientImpl.java index 4a417045c5ad..d95264ac7499 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolsClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolsClientImpl.java @@ -65,11 +65,10 @@ public final class ResourcePoolsClientImpl implements ResourcePoolsClient { */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface ResourcePoolsService { + public interface ResourcePoolsService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -84,8 +83,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -99,8 +97,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -115,8 +112,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -142,8 +138,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/resourcePools") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -312,6 +307,33 @@ private PollerFlux, ResourcePoolInner> beginCreate this.client.getContext()); } + /** + * Implements resourcePool PUT method. + * + *

Create Or Update resourcePool. + * + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the resourcePool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ResourcePoolInner> beginCreateAsync( + String resourceGroupName, String resourcePoolName) { + final ResourcePoolInner body = null; + Mono>> mono = createWithResponseAsync(resourceGroupName, resourcePoolName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ResourcePoolInner.class, + ResourcePoolInner.class, + this.client.getContext()); + } + /** * Implements resourcePool PUT method. * @@ -345,7 +367,6 @@ private PollerFlux, ResourcePoolInner> beginCreate * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -353,8 +374,9 @@ private PollerFlux, ResourcePoolInner> beginCreate */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ResourcePoolInner> beginCreate( - String resourceGroupName, String resourcePoolName, ResourcePoolInner body) { - return beginCreateAsync(resourceGroupName, resourcePoolName, body).getSyncPoller(); + String resourceGroupName, String resourcePoolName) { + final ResourcePoolInner body = null; + return this.beginCreateAsync(resourceGroupName, resourcePoolName, body).getSyncPoller(); } /** @@ -374,7 +396,7 @@ public SyncPoller, ResourcePoolInner> beginCreate( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ResourcePoolInner> beginCreate( String resourceGroupName, String resourcePoolName, ResourcePoolInner body, Context context) { - return beginCreateAsync(resourceGroupName, resourcePoolName, body, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, resourcePoolName, body, context).getSyncPoller(); } /** @@ -440,24 +462,6 @@ private Mono createAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Implements resourcePool PUT method. - * - *

Create Or Update resourcePool. - * - * @param resourceGroupName The Resource Group Name. - * @param resourcePoolName Name of the resourcePool. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the resourcePool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourcePoolInner create(String resourceGroupName, String resourcePoolName, ResourcePoolInner body) { - return createAsync(resourceGroupName, resourcePoolName, body).block(); - } - /** * Implements resourcePool PUT method. * @@ -621,14 +625,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the resourcePool. + * @return define the resourcePool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourcePoolInner getByResourceGroup(String resourceGroupName, String resourcePoolName) { - return getByResourceGroupAsync(resourceGroupName, resourcePoolName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourcePoolName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourcePoolName, context).block(); } /** @@ -638,16 +644,14 @@ public ResourcePoolInner getByResourceGroup(String resourceGroupName, String res * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the resourcePool along with {@link Response}. + * @return define the resourcePool. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String resourcePoolName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourcePoolName, context).block(); + public ResourcePoolInner getByResourceGroup(String resourceGroupName, String resourcePoolName) { + return getByResourceGroupWithResponse(resourceGroupName, resourcePoolName, Context.NONE).getValue(); } /** @@ -767,14 +771,14 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. - * @param body Resource properties to update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the resourcePool on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourcePoolName, ResourcePatch body) { + private Mono updateAsync(String resourceGroupName, String resourcePoolName) { + final ResourcePatch body = null; return updateWithResponseAsync(resourceGroupName, resourcePoolName, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -786,16 +790,17 @@ private Mono updateAsync(String resourceGroupName, String res * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. + * @param body Resource properties to update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the resourcePool on successful completion of {@link Mono}. + * @return define the resourcePool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourcePoolName) { - final ResourcePatch body = null; - return updateWithResponseAsync(resourceGroupName, resourcePoolName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response updateWithResponse( + String resourceGroupName, String resourcePoolName, ResourcePatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, resourcePoolName, body, context).block(); } /** @@ -813,27 +818,7 @@ private Mono updateAsync(String resourceGroupName, String res @ServiceMethod(returns = ReturnType.SINGLE) public ResourcePoolInner update(String resourceGroupName, String resourcePoolName) { final ResourcePatch body = null; - return updateAsync(resourceGroupName, resourcePoolName, body).block(); - } - - /** - * Updates a resourcePool. - * - *

API to update certain properties of the resourcePool resource. - * - * @param resourceGroupName The Resource Group Name. - * @param resourcePoolName Name of the resourcePool. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the resourcePool along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String resourcePoolName, ResourcePatch body, Context context) { - return updateWithResponseAsync(resourceGroupName, resourcePoolName, body, context).block(); + return updateWithResponse(resourceGroupName, resourcePoolName, body, Context.NONE).getValue(); } /** @@ -963,6 +948,28 @@ private PollerFlux, Void> beginDeleteAsync( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } + /** + * Deletes an resourcePool. + * + *

Implements resourcePool DELETE method. + * + * @param resourceGroupName The Resource Group Name. + * @param resourcePoolName Name of the resourcePool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync(String resourceGroupName, String resourcePoolName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourcePoolName, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + /** * Deletes an resourcePool. * @@ -995,16 +1002,15 @@ private PollerFlux, Void> beginDeleteAsync( * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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> beginDelete( - String resourceGroupName, String resourcePoolName, Boolean force) { - return beginDeleteAsync(resourceGroupName, resourcePoolName, force).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourcePoolName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, resourcePoolName, force).getSyncPoller(); } /** @@ -1024,7 +1030,7 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourcePoolName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, resourcePoolName, force, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, resourcePoolName, force, context).getSyncPoller(); } /** @@ -1088,23 +1094,6 @@ private Mono deleteAsync(String resourceGroupName, String resourcePoolName .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes an resourcePool. - * - *

Implements resourcePool DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param resourcePoolName Name of the resourcePool. - * @param force Whether force delete was specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resourcePoolName, Boolean force) { - deleteAsync(resourceGroupName, resourcePoolName, force).block(); - } - /** * Deletes an resourcePool. * @@ -1470,7 +1459,8 @@ public PagedIterable listByResourceGroup(String resourceGroup /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1505,7 +1495,8 @@ private Mono> listNextSinglePageAsync(String ne /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1541,7 +1532,8 @@ private Mono> listNextSinglePageAsync(String ne /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1577,7 +1569,8 @@ private Mono> listByResourceGroupNextSinglePage /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolsImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolsImpl.java index 98ac6cde5b00..80f47848cec8 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolsImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/ResourcePoolsImpl.java @@ -28,15 +28,6 @@ public ResourcePoolsImpl( this.serviceManager = serviceManager; } - public ResourcePool getByResourceGroup(String resourceGroupName, String resourcePoolName) { - ResourcePoolInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourcePoolName); - if (inner != null) { - return new ResourcePoolImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String resourcePoolName, Context context) { Response inner = @@ -52,8 +43,13 @@ public Response getByResourceGroupWithResponse( } } - public void delete(String resourceGroupName, String resourcePoolName, Boolean force) { - this.serviceClient().delete(resourceGroupName, resourcePoolName, force); + public ResourcePool getByResourceGroup(String resourceGroupName, String resourcePoolName) { + ResourcePoolInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourcePoolName); + if (inner != null) { + return new ResourcePoolImpl(inner, this.manager()); + } else { + return null; + } } public void delete(String resourceGroupName, String resourcePoolName) { diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCenterImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCenterImpl.java index fa94fc3a7580..0058490b044f 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCenterImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCenterImpl.java @@ -9,6 +9,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.fluent.models.VCenterInner; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourcePatch; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.azure.resourcemanager.connectedvmware.models.VCenter; @@ -100,7 +101,7 @@ public List statuses() { } } - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCentersClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCentersClientImpl.java index 631b47155948..27ce63ce4c3e 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCentersClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCentersClientImpl.java @@ -64,11 +64,10 @@ public final class VCentersClientImpl implements VCentersClient { */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface VCentersService { + public interface VCentersService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -83,8 +82,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -98,8 +96,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -114,8 +111,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -141,8 +137,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/vcenters") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -305,6 +300,29 @@ private PollerFlux, VCenterInner> beginCreateAsync( mono, this.client.getHttpPipeline(), VCenterInner.class, VCenterInner.class, this.client.getContext()); } + /** + * Implements vCenter PUT method. + * + *

Create Or Update vCenter. + * + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the vCenter. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VCenterInner> beginCreateAsync( + String resourceGroupName, String vcenterName) { + final VCenterInner body = null; + Mono>> mono = createWithResponseAsync(resourceGroupName, vcenterName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VCenterInner.class, VCenterInner.class, this.client.getContext()); + } + /** * Implements vCenter PUT method. * @@ -337,7 +355,6 @@ private PollerFlux, VCenterInner> beginCreateAsync( * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -345,8 +362,9 @@ private PollerFlux, VCenterInner> beginCreateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VCenterInner> beginCreate( - String resourceGroupName, String vcenterName, VCenterInner body) { - return beginCreateAsync(resourceGroupName, vcenterName, body).getSyncPoller(); + String resourceGroupName, String vcenterName) { + final VCenterInner body = null; + return this.beginCreateAsync(resourceGroupName, vcenterName, body).getSyncPoller(); } /** @@ -366,7 +384,7 @@ public SyncPoller, VCenterInner> beginCreate( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VCenterInner> beginCreate( String resourceGroupName, String vcenterName, VCenterInner body, Context context) { - return beginCreateAsync(resourceGroupName, vcenterName, body, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, vcenterName, body, context).getSyncPoller(); } /** @@ -431,24 +449,6 @@ private Mono createAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Implements vCenter PUT method. - * - *

Create Or Update vCenter. - * - * @param resourceGroupName The Resource Group Name. - * @param vcenterName Name of the vCenter. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the vCenter. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VCenterInner create(String resourceGroupName, String vcenterName, VCenterInner body) { - return createAsync(resourceGroupName, vcenterName, body).block(); - } - /** * Implements vCenter PUT method. * @@ -609,14 +609,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the vCenter. + * @return defines the vCenter along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VCenterInner getByResourceGroup(String resourceGroupName, String vcenterName) { - return getByResourceGroupAsync(resourceGroupName, vcenterName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vcenterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vcenterName, context).block(); } /** @@ -626,16 +628,14 @@ public VCenterInner getByResourceGroup(String resourceGroupName, String vcenterN * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the vCenter along with {@link Response}. + * @return defines the vCenter. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vcenterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vcenterName, context).block(); + public VCenterInner getByResourceGroup(String resourceGroupName, String vcenterName) { + return getByResourceGroupWithResponse(resourceGroupName, vcenterName, Context.NONE).getValue(); } /** @@ -753,14 +753,14 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. - * @param body Resource properties to update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the vCenter on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String vcenterName, ResourcePatch body) { + private Mono updateAsync(String resourceGroupName, String vcenterName) { + final ResourcePatch body = null; return updateWithResponseAsync(resourceGroupName, vcenterName, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -772,16 +772,17 @@ private Mono updateAsync(String resourceGroupName, String vcenterN * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. + * @param body Resource properties to update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the vCenter on successful completion of {@link Mono}. + * @return defines the vCenter along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String vcenterName) { - final ResourcePatch body = null; - return updateWithResponseAsync(resourceGroupName, vcenterName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response updateWithResponse( + String resourceGroupName, String vcenterName, ResourcePatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, vcenterName, body, context).block(); } /** @@ -799,27 +800,7 @@ private Mono updateAsync(String resourceGroupName, String vcenterN @ServiceMethod(returns = ReturnType.SINGLE) public VCenterInner update(String resourceGroupName, String vcenterName) { final ResourcePatch body = null; - return updateAsync(resourceGroupName, vcenterName, body).block(); - } - - /** - * Updates a vCenter. - * - *

API to update certain properties of the vCenter resource. - * - * @param resourceGroupName The Resource Group Name. - * @param vcenterName Name of the vCenter. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the vCenter along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String vcenterName, ResourcePatch body, Context context) { - return updateWithResponseAsync(resourceGroupName, vcenterName, body, context).block(); + return updateWithResponse(resourceGroupName, vcenterName, body, Context.NONE).getValue(); } /** @@ -947,6 +928,28 @@ private PollerFlux, Void> beginDeleteAsync( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } + /** + * Deletes an vCenter. + * + *

Implements vCenter DELETE method. + * + * @param resourceGroupName The Resource Group Name. + * @param vcenterName Name of the vCenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync(String resourceGroupName, String vcenterName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vcenterName, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + /** * Deletes an vCenter. * @@ -978,15 +981,15 @@ private PollerFlux, Void> beginDeleteAsync( * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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> beginDelete(String resourceGroupName, String vcenterName, Boolean force) { - return beginDeleteAsync(resourceGroupName, vcenterName, force).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String vcenterName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, vcenterName, force).getSyncPoller(); } /** @@ -1006,7 +1009,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String vcenterName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, vcenterName, force, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, vcenterName, force, context).getSyncPoller(); } /** @@ -1070,23 +1073,6 @@ private Mono deleteAsync(String resourceGroupName, String vcenterName, Boo .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes an vCenter. - * - *

Implements vCenter DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param vcenterName Name of the vCenter. - * @param force Whether force delete was specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 vcenterName, Boolean force) { - deleteAsync(resourceGroupName, vcenterName, force).block(); - } - /** * Deletes an vCenter. * @@ -1452,7 +1438,8 @@ public PagedIterable listByResourceGroup(String resourceGroupName, /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1487,7 +1474,8 @@ private Mono> listNextSinglePageAsync(String nextLin /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1523,7 +1511,8 @@ private Mono> listNextSinglePageAsync(String nextLin /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1559,7 +1548,8 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCentersImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCentersImpl.java index fb3399d0d5dd..d73d2b60fec6 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCentersImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VCentersImpl.java @@ -27,15 +27,6 @@ public VCentersImpl( this.serviceManager = serviceManager; } - public VCenter getByResourceGroup(String resourceGroupName, String vcenterName) { - VCenterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vcenterName); - if (inner != null) { - return new VCenterImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String vcenterName, Context context) { Response inner = @@ -51,8 +42,13 @@ public Response getByResourceGroupWithResponse( } } - public void delete(String resourceGroupName, String vcenterName, Boolean force) { - this.serviceClient().delete(resourceGroupName, vcenterName, force); + public VCenter getByResourceGroup(String resourceGroupName, String vcenterName) { + VCenterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vcenterName); + if (inner != null) { + return new VCenterImpl(inner, this.manager()); + } else { + return null; + } } public void delete(String resourceGroupName, String vcenterName) { diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentsClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VMInstanceGuestAgentsClientImpl.java similarity index 57% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentsClientImpl.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VMInstanceGuestAgentsClientImpl.java index cd49e25923bb..0ceaf1d809d3 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/GuestAgentsClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VMInstanceGuestAgentsClientImpl.java @@ -31,51 +31,48 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.connectedvmware.fluent.GuestAgentsClient; +import com.azure.resourcemanager.connectedvmware.fluent.VMInstanceGuestAgentsClient; import com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner; import com.azure.resourcemanager.connectedvmware.models.GuestAgentList; 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 GuestAgentsClient. */ -public final class GuestAgentsClientImpl implements GuestAgentsClient { +/** An instance of this class provides access to all the operations defined in VMInstanceGuestAgentsClient. */ +public final class VMInstanceGuestAgentsClientImpl implements VMInstanceGuestAgentsClient { /** The proxy service used to perform REST calls. */ - private final GuestAgentsService service; + private final VMInstanceGuestAgentsService service; /** The service client containing this operation class. */ private final ConnectedVMwareClientImpl client; /** - * Initializes an instance of GuestAgentsClientImpl. + * Initializes an instance of VMInstanceGuestAgentsClientImpl. * * @param client the instance of the service client containing this operation class. */ - GuestAgentsClientImpl(ConnectedVMwareClientImpl client) { + VMInstanceGuestAgentsClientImpl(ConnectedVMwareClientImpl client) { this.service = - RestProxy.create(GuestAgentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy + .create(VMInstanceGuestAgentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ConnectedVMwareClientGuestAgents to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for ConnectedVMwareClientVMInstanceGuestAgents to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface GuestAgentsService { + public interface VMInstanceGuestAgentsService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}") + "/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents/default") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @PathParam("name") String name, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") GuestAgentInner body, @HeaderParam("Accept") String accept, @@ -83,47 +80,35 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}") + "/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @PathParam("name") String name, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}") - @ExpectedResponses({200, 202, 204}) + "/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents/default") + @ExpectedResponses({202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @PathParam("name") String name, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents") + @Get("/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVm( + Mono> list( @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -132,7 +117,7 @@ Mono> listByVm( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVmNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -144,9 +129,8 @@ Mono> listByVmNext( * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -154,30 +138,15 @@ Mono> listByVmNext( * @return defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body) { + private Mono>> createWithResponseAsync(String resourceUri, GuestAgentInner body) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } if (body != null) { body.validate(); @@ -188,15 +157,7 @@ private Mono>> createWithResponseAsync( context -> service .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - name, - this.client.getApiVersion(), - body, - accept, - context)) + this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -205,9 +166,8 @@ private Mono>> createWithResponseAsync( * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -217,29 +177,15 @@ private Mono>> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body, Context context) { + String resourceUri, GuestAgentInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } if (body != null) { body.validate(); @@ -247,16 +193,7 @@ private Mono>> createWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - name, - this.client.getApiVersion(), - body, - accept, - context); + .create(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context); } /** @@ -264,9 +201,8 @@ private Mono>> createWithResponseAsync( * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -275,9 +211,8 @@ private Mono>> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, GuestAgentInner> beginCreateAsync( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, virtualMachineName, name, body); + String resourceUri, GuestAgentInner body) { + Mono>> mono = createWithResponseAsync(resourceUri, body); return this .client .getLroResult( @@ -293,26 +228,25 @@ private PollerFlux, GuestAgentInner> beginCreateAsyn * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. - * @param body Request payload. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GuestAgentInner> beginCreateAsync( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, virtualMachineName, name, body, context); + private PollerFlux, GuestAgentInner> beginCreateAsync(String resourceUri) { + final GuestAgentInner body = null; + Mono>> mono = createWithResponseAsync(resourceUri, body); return this .client .getLroResult( - mono, this.client.getHttpPipeline(), GuestAgentInner.class, GuestAgentInner.class, context); + mono, + this.client.getHttpPipeline(), + GuestAgentInner.class, + GuestAgentInner.class, + this.client.getContext()); } /** @@ -320,19 +254,24 @@ private PollerFlux, GuestAgentInner> beginCreateAsyn * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param body Request payload. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 defines the GuestAgent. + * @return the {@link PollerFlux} for polling of defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GuestAgentInner> beginCreate( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body) { - return beginCreateAsync(resourceGroupName, virtualMachineName, name, body).getSyncPoller(); + private PollerFlux, GuestAgentInner> beginCreateAsync( + String resourceUri, GuestAgentInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceUri, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GuestAgentInner.class, GuestAgentInner.class, context); } /** @@ -340,20 +279,17 @@ public SyncPoller, GuestAgentInner> beginCreate( * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. - * @param body Request payload. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GuestAgentInner> beginCreate( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body, Context context) { - return beginCreateAsync(resourceGroupName, virtualMachineName, name, body, context).getSyncPoller(); + public SyncPoller, GuestAgentInner> beginCreate(String resourceUri) { + final GuestAgentInner body = null; + return this.beginCreateAsync(resourceUri, body).getSyncPoller(); } /** @@ -361,21 +297,19 @@ public SyncPoller, GuestAgentInner> beginCreate( * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param body Request payload. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the GuestAgent on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of defines the GuestAgent. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body) { - return beginCreateAsync(resourceGroupName, virtualMachineName, name, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GuestAgentInner> beginCreate( + String resourceUri, GuestAgentInner body, Context context) { + return this.beginCreateAsync(resourceUri, body, context).getSyncPoller(); } /** @@ -383,20 +317,17 @@ private Mono createAsync( * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the GuestAgent on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String virtualMachineName, String name) { - final GuestAgentInner body = null; - return beginCreateAsync(resourceGroupName, virtualMachineName, name, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createAsync(String resourceUri, GuestAgentInner body) { + return beginCreateAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -404,22 +335,17 @@ private Mono createAsync(String resourceGroupName, String virtu * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. - * @param body Request payload. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the GuestAgent on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body, Context context) { - return beginCreateAsync(resourceGroupName, virtualMachineName, name, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createAsync(String resourceUri) { + final GuestAgentInner body = null; + return beginCreateAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -427,19 +353,18 @@ private Mono createAsync( * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param body Request payload. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the GuestAgent. + * @return defines the GuestAgent on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GuestAgentInner create( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body) { - return createAsync(resourceGroupName, virtualMachineName, name, body).block(); + private Mono createAsync(String resourceUri, GuestAgentInner body, Context context) { + return beginCreateAsync(resourceUri, body, context).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -447,18 +372,17 @@ public GuestAgentInner create( * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GuestAgentInner create(String resourceGroupName, String virtualMachineName, String name) { + public GuestAgentInner create(String resourceUri) { final GuestAgentInner body = null; - return createAsync(resourceGroupName, virtualMachineName, name, body).block(); + return createAsync(resourceUri, body).block(); } /** @@ -466,9 +390,8 @@ public GuestAgentInner create(String resourceGroupName, String virtualMachineNam * *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the guestAgents. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -477,9 +400,8 @@ public GuestAgentInner create(String resourceGroupName, String virtualMachineNam * @return defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GuestAgentInner create( - String resourceGroupName, String virtualMachineName, String name, GuestAgentInner body, Context context) { - return createAsync(resourceGroupName, virtualMachineName, name, body, context).block(); + public GuestAgentInner create(String resourceUri, GuestAgentInner body, Context context) { + return createAsync(resourceUri, body, context).block(); } /** @@ -487,54 +409,29 @@ public GuestAgentInner create( * *

Implements GuestAgent GET method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String virtualMachineName, String name) { + private Mono> getWithResponseAsync(String resourceUri) { 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - name, - this.client.getApiVersion(), - accept, - context)) + service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -543,9 +440,8 @@ private Mono> getWithResponseAsync( * *

Implements GuestAgent GET method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -553,43 +449,19 @@ private Mono> getWithResponseAsync( * @return defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String virtualMachineName, String name, Context context) { + private Mono> getWithResponseAsync(String resourceUri, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - name, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); } /** @@ -597,18 +469,16 @@ private Mono> getWithResponseAsync( * *

Implements GuestAgent GET method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the GuestAgent on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String virtualMachineName, String name) { - return getWithResponseAsync(resourceGroupName, virtualMachineName, name) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -616,17 +486,17 @@ private Mono getAsync(String resourceGroupName, String virtualM * *

Implements GuestAgent GET method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the GuestAgent. + * @return defines the GuestAgent along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GuestAgentInner get(String resourceGroupName, String virtualMachineName, String name) { - return getAsync(resourceGroupName, virtualMachineName, name).block(); + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); } /** @@ -634,19 +504,16 @@ public GuestAgentInner get(String resourceGroupName, String virtualMachineName, * *

Implements GuestAgent GET method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the GuestAgent along with {@link Response}. + * @return defines the GuestAgent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String virtualMachineName, String name, Context context) { - return getWithResponseAsync(resourceGroupName, virtualMachineName, name, context).block(); + public GuestAgentInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); } /** @@ -654,54 +521,30 @@ public Response getWithResponse( * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 virtualMachineName, String name) { + private Mono>> deleteWithResponseAsync(String resourceUri) { 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - name, - this.client.getApiVersion(), - accept, - context)) + .delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -710,9 +553,8 @@ private Mono>> deleteWithResponseAsync( * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -720,43 +562,19 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualMachineName, String name, Context context) { + private Mono>> deleteWithResponseAsync(String resourceUri, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri 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, - virtualMachineName, - name, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); } /** @@ -764,18 +582,16 @@ private Mono>> deleteWithResponseAsync( * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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> beginDeleteAsync( - String resourceGroupName, String virtualMachineName, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualMachineName, name); + private PollerFlux, Void> beginDeleteAsync(String resourceUri) { + Mono>> mono = deleteWithResponseAsync(resourceUri); return this .client .getLroResult( @@ -787,9 +603,8 @@ private PollerFlux, Void> beginDeleteAsync( * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -797,11 +612,9 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualMachineName, String name, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceUri, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualMachineName, name, context); + Mono>> mono = deleteWithResponseAsync(resourceUri, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); @@ -812,18 +625,16 @@ private PollerFlux, Void> beginDeleteAsync( * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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> beginDelete( - String resourceGroupName, String virtualMachineName, String name) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, name).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceUri) { + return this.beginDeleteAsync(resourceUri).getSyncPoller(); } /** @@ -831,9 +642,8 @@ public SyncPoller, Void> beginDelete( * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -841,9 +651,8 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, name, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceUri, Context context) { + return this.beginDeleteAsync(resourceUri, context).getSyncPoller(); } /** @@ -851,19 +660,16 @@ public SyncPoller, Void> beginDelete( * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 virtualMachineName, String name) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, name) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAsync(String resourceUri) { + return beginDeleteAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -871,9 +677,8 @@ private Mono deleteAsync(String resourceGroupName, String virtualMachineNa * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -881,10 +686,8 @@ private Mono deleteAsync(String resourceGroupName, String virtualMachineNa * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, name, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAsync(String resourceUri, Context context) { + return beginDeleteAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -892,16 +695,15 @@ private Mono deleteAsync(String resourceGroupName, String virtualMachineNa * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 virtualMachineName, String name) { - deleteAsync(resourceGroupName, virtualMachineName, name).block(); + public void delete(String resourceUri) { + deleteAsync(resourceUri).block(); } /** @@ -909,17 +711,16 @@ public void delete(String resourceGroupName, String virtualMachineName, String n * *

Implements GuestAgent DELETE method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 virtualMachineName, String name, Context context) { - deleteAsync(resourceGroupName, virtualMachineName, name, context).block(); + public void delete(String resourceUri, Context context) { + deleteAsync(resourceUri, context).block(); } /** @@ -927,49 +728,29 @@ public void delete(String resourceGroupName, String virtualMachineName, String n * *

Returns the list of GuestAgent of the given vm. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 GuestAgent along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmSinglePageAsync( - String resourceGroupName, String virtualMachineName) { + private Mono> listSinglePageAsync(String resourceUri) { 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> - service - .listByVm( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - accept, - context)) + service.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -987,8 +768,8 @@ private Mono> listByVmSinglePageAsync( * *

Returns the list of GuestAgent of the given vm. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -996,39 +777,20 @@ private Mono> listByVmSinglePageAsync( * @return list of GuestAgent along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmSinglePageAsync( - String resourceGroupName, String virtualMachineName, Context context) { + private Mono> listSinglePageAsync(String resourceUri, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByVm( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - accept, - context) + .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1045,18 +807,16 @@ private Mono> listByVmSinglePageAsync( * *

Returns the list of GuestAgent of the given vm. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 GuestAgent as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVmAsync(String resourceGroupName, String virtualMachineName) { - return new PagedFlux<>( - () -> listByVmSinglePageAsync(resourceGroupName, virtualMachineName), - nextLink -> listByVmNextSinglePageAsync(nextLink)); + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -1064,8 +824,8 @@ private PagedFlux listByVmAsync(String resourceGroupName, Strin * *

Returns the list of GuestAgent of the given vm. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1073,11 +833,9 @@ private PagedFlux listByVmAsync(String resourceGroupName, Strin * @return list of GuestAgent as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVmAsync( - String resourceGroupName, String virtualMachineName, Context context) { + private PagedFlux listAsync(String resourceUri, Context context) { return new PagedFlux<>( - () -> listByVmSinglePageAsync(resourceGroupName, virtualMachineName, context), - nextLink -> listByVmNextSinglePageAsync(nextLink, context)); + () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -1085,16 +843,16 @@ private PagedFlux listByVmAsync( * *

Returns the list of GuestAgent of the given vm. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 GuestAgent as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVm(String resourceGroupName, String virtualMachineName) { - return new PagedIterable<>(listByVmAsync(resourceGroupName, virtualMachineName)); + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); } /** @@ -1102,8 +860,8 @@ public PagedIterable listByVm(String resourceGroupName, String * *

Returns the list of GuestAgent of the given vm. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1111,22 +869,22 @@ public PagedIterable listByVm(String resourceGroupName, String * @return list of GuestAgent as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVm( - String resourceGroupName, String virtualMachineName, Context context) { - return new PagedIterable<>(listByVmAsync(resourceGroupName, virtualMachineName, context)); + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of GuestAgent along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1138,7 +896,7 @@ private Mono> listByVmNextSinglePageAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByVmNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1154,7 +912,8 @@ private Mono> listByVmNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1162,7 +921,7 @@ private Mono> listByVmNextSinglePageAsync(String * @return list of GuestAgent along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1175,7 +934,7 @@ private Mono> listByVmNextSinglePageAsync(String final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByVmNext(nextLink, this.client.getEndpoint(), accept, context) + .listNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VMInstanceGuestAgentsImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VMInstanceGuestAgentsImpl.java new file mode 100644 index 000000000000..781e41ee37e0 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VMInstanceGuestAgentsImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.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.connectedvmware.fluent.VMInstanceGuestAgentsClient; +import com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.connectedvmware.models.GuestAgent; +import com.azure.resourcemanager.connectedvmware.models.VMInstanceGuestAgents; + +public final class VMInstanceGuestAgentsImpl implements VMInstanceGuestAgents { + private static final ClientLogger LOGGER = new ClientLogger(VMInstanceGuestAgentsImpl.class); + + private final VMInstanceGuestAgentsClient innerClient; + + private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; + + public VMInstanceGuestAgentsImpl( + VMInstanceGuestAgentsClient innerClient, + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public GuestAgent create(String resourceUri) { + GuestAgentInner inner = this.serviceClient().create(resourceUri); + if (inner != null) { + return new GuestAgentImpl(inner, this.manager()); + } else { + return null; + } + } + + public GuestAgent create(String resourceUri, GuestAgentInner body, Context context) { + GuestAgentInner inner = this.serviceClient().create(resourceUri, body, context); + if (inner != null) { + return new GuestAgentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GuestAgentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GuestAgent get(String resourceUri) { + GuestAgentInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new GuestAgentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceUri) { + this.serviceClient().delete(resourceUri); + } + + public void delete(String resourceUri, Context context) { + this.serviceClient().delete(resourceUri, context); + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return Utils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return Utils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); + } + + private VMInstanceGuestAgentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineAssessPatchesResultImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineAssessPatchesResultImpl.java deleted file mode 100644 index f21e75991690..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineAssessPatchesResultImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.implementation; - -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineAssessPatchesResultInner; -import com.azure.resourcemanager.connectedvmware.models.AvailablePatchCountByClassification; -import com.azure.resourcemanager.connectedvmware.models.ErrorDetail; -import com.azure.resourcemanager.connectedvmware.models.OsTypeUM; -import com.azure.resourcemanager.connectedvmware.models.PatchOperationStartedBy; -import com.azure.resourcemanager.connectedvmware.models.PatchOperationStatus; -import com.azure.resourcemanager.connectedvmware.models.PatchServiceUsed; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineAssessPatchesResult; -import java.time.OffsetDateTime; - -public final class VirtualMachineAssessPatchesResultImpl implements VirtualMachineAssessPatchesResult { - private VirtualMachineAssessPatchesResultInner innerObject; - - private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; - - VirtualMachineAssessPatchesResultImpl( - VirtualMachineAssessPatchesResultInner innerObject, - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public PatchOperationStatus status() { - return this.innerModel().status(); - } - - public String assessmentActivityId() { - return this.innerModel().assessmentActivityId(); - } - - public Boolean rebootPending() { - return this.innerModel().rebootPending(); - } - - public AvailablePatchCountByClassification availablePatchCountByClassification() { - return this.innerModel().availablePatchCountByClassification(); - } - - public OffsetDateTime startDateTime() { - return this.innerModel().startDateTime(); - } - - public OffsetDateTime lastModifiedDateTime() { - return this.innerModel().lastModifiedDateTime(); - } - - public PatchOperationStartedBy startedBy() { - return this.innerModel().startedBy(); - } - - public PatchServiceUsed patchServiceUsed() { - return this.innerModel().patchServiceUsed(); - } - - public OsTypeUM osType() { - return this.innerModel().osType(); - } - - public ErrorDetail errorDetails() { - return this.innerModel().errorDetails(); - } - - public VirtualMachineAssessPatchesResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineImpl.java deleted file mode 100644 index 2e802fc07828..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineImpl.java +++ /dev/null @@ -1,443 +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.connectedvmware.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; -import com.azure.resourcemanager.connectedvmware.models.FirmwareType; -import com.azure.resourcemanager.connectedvmware.models.GuestAgentProfile; -import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; -import com.azure.resourcemanager.connectedvmware.models.Identity; -import com.azure.resourcemanager.connectedvmware.models.NetworkProfile; -import com.azure.resourcemanager.connectedvmware.models.NetworkProfileUpdate; -import com.azure.resourcemanager.connectedvmware.models.OsProfile; -import com.azure.resourcemanager.connectedvmware.models.OsProfileUpdate; -import com.azure.resourcemanager.connectedvmware.models.PlacementProfile; -import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; -import com.azure.resourcemanager.connectedvmware.models.SecurityProfile; -import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; -import com.azure.resourcemanager.connectedvmware.models.StorageProfile; -import com.azure.resourcemanager.connectedvmware.models.StorageProfileUpdate; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachine; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineUpdate; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class VirtualMachineImpl implements VirtualMachine, VirtualMachine.Definition, VirtualMachine.Update { - private VirtualMachineInner innerObject; - - private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager 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 ExtendedLocation extendedLocation() { - return this.innerModel().extendedLocation(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public Identity identity() { - return this.innerModel().identity(); - } - - public String resourcePoolId() { - return this.innerModel().resourcePoolId(); - } - - public String templateId() { - return this.innerModel().templateId(); - } - - public String vCenterId() { - return this.innerModel().vCenterId(); - } - - public PlacementProfile placementProfile() { - return this.innerModel().placementProfile(); - } - - public OsProfile osProfile() { - return this.innerModel().osProfile(); - } - - public HardwareProfile hardwareProfile() { - return this.innerModel().hardwareProfile(); - } - - public NetworkProfile networkProfile() { - return this.innerModel().networkProfile(); - } - - public StorageProfile storageProfile() { - return this.innerModel().storageProfile(); - } - - public GuestAgentProfile guestAgentProfile() { - return this.innerModel().guestAgentProfile(); - } - - public SecurityProfile securityProfile() { - return this.innerModel().securityProfile(); - } - - public String moRefId() { - return this.innerModel().moRefId(); - } - - public String inventoryItemId() { - return this.innerModel().inventoryItemId(); - } - - public String moName() { - return this.innerModel().moName(); - } - - public String folderPath() { - return this.innerModel().folderPath(); - } - - public String instanceUuid() { - return this.innerModel().instanceUuid(); - } - - public String smbiosUuid() { - return this.innerModel().smbiosUuid(); - } - - public FirmwareType firmwareType() { - return this.innerModel().firmwareType(); - } - - public String powerState() { - return this.innerModel().powerState(); - } - - public String customResourceName() { - return this.innerModel().customResourceName(); - } - - public String uuid() { - return this.innerModel().uuid(); - } - - public List statuses() { - List inner = this.innerModel().statuses(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public String vmId() { - return this.innerModel().vmId(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public VirtualMachineInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String virtualMachineName; - - private VirtualMachineUpdate updateBody; - - public VirtualMachineImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public VirtualMachine create() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .create(resourceGroupName, virtualMachineName, this.innerModel(), Context.NONE); - return this; - } - - public VirtualMachine create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .create(resourceGroupName, virtualMachineName, this.innerModel(), context); - return this; - } - - VirtualMachineImpl(String name, com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerObject = new VirtualMachineInner(); - this.serviceManager = serviceManager; - this.virtualMachineName = name; - } - - public VirtualMachineImpl update() { - this.updateBody = new VirtualMachineUpdate(); - return this; - } - - public VirtualMachine apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .update(resourceGroupName, virtualMachineName, updateBody, Context.NONE); - return this; - } - - public VirtualMachine apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .update(resourceGroupName, virtualMachineName, updateBody, context); - return this; - } - - VirtualMachineImpl( - VirtualMachineInner innerObject, - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.virtualMachineName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); - } - - public VirtualMachine refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, Context.NONE) - .getValue(); - return this; - } - - public VirtualMachine refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, context) - .getValue(); - return this; - } - - public void stop(StopVirtualMachineOptions body) { - serviceManager.virtualMachines().stop(resourceGroupName, virtualMachineName, body); - } - - public void stop() { - serviceManager.virtualMachines().stop(resourceGroupName, virtualMachineName); - } - - public void stop(StopVirtualMachineOptions body, Context context) { - serviceManager.virtualMachines().stop(resourceGroupName, virtualMachineName, body, context); - } - - public void start() { - serviceManager.virtualMachines().start(resourceGroupName, virtualMachineName); - } - - public void start(Context context) { - serviceManager.virtualMachines().start(resourceGroupName, virtualMachineName, context); - } - - public void restart() { - serviceManager.virtualMachines().restart(resourceGroupName, virtualMachineName); - } - - public void restart(Context context) { - serviceManager.virtualMachines().restart(resourceGroupName, virtualMachineName, context); - } - - public VirtualMachineImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public VirtualMachineImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public VirtualMachineImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateBody.withTags(tags); - return this; - } - } - - public VirtualMachineImpl withExtendedLocation(ExtendedLocation extendedLocation) { - this.innerModel().withExtendedLocation(extendedLocation); - return this; - } - - public VirtualMachineImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public VirtualMachineImpl withIdentity(Identity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updateBody.withIdentity(identity); - return this; - } - } - - public VirtualMachineImpl withResourcePoolId(String resourcePoolId) { - this.innerModel().withResourcePoolId(resourcePoolId); - return this; - } - - public VirtualMachineImpl withTemplateId(String templateId) { - this.innerModel().withTemplateId(templateId); - return this; - } - - public VirtualMachineImpl withVCenterId(String vCenterId) { - this.innerModel().withVCenterId(vCenterId); - return this; - } - - public VirtualMachineImpl withPlacementProfile(PlacementProfile placementProfile) { - this.innerModel().withPlacementProfile(placementProfile); - return this; - } - - public VirtualMachineImpl withOsProfile(OsProfile osProfile) { - this.innerModel().withOsProfile(osProfile); - return this; - } - - public VirtualMachineImpl withHardwareProfile(HardwareProfile hardwareProfile) { - if (isInCreateMode()) { - this.innerModel().withHardwareProfile(hardwareProfile); - return this; - } else { - this.updateBody.withHardwareProfile(hardwareProfile); - return this; - } - } - - public VirtualMachineImpl withNetworkProfile(NetworkProfile networkProfile) { - this.innerModel().withNetworkProfile(networkProfile); - return this; - } - - public VirtualMachineImpl withStorageProfile(StorageProfile storageProfile) { - this.innerModel().withStorageProfile(storageProfile); - return this; - } - - public VirtualMachineImpl withGuestAgentProfile(GuestAgentProfile guestAgentProfile) { - this.innerModel().withGuestAgentProfile(guestAgentProfile); - return this; - } - - public VirtualMachineImpl withSecurityProfile(SecurityProfile securityProfile) { - this.innerModel().withSecurityProfile(securityProfile); - return this; - } - - public VirtualMachineImpl withMoRefId(String moRefId) { - this.innerModel().withMoRefId(moRefId); - return this; - } - - public VirtualMachineImpl withInventoryItemId(String inventoryItemId) { - this.innerModel().withInventoryItemId(inventoryItemId); - return this; - } - - public VirtualMachineImpl withSmbiosUuid(String smbiosUuid) { - this.innerModel().withSmbiosUuid(smbiosUuid); - return this; - } - - public VirtualMachineImpl withFirmwareType(FirmwareType firmwareType) { - this.innerModel().withFirmwareType(firmwareType); - return this; - } - - public VirtualMachineImpl withOsProfile(OsProfileUpdate osProfile) { - this.updateBody.withOsProfile(osProfile); - return this; - } - - public VirtualMachineImpl withStorageProfile(StorageProfileUpdate storageProfile) { - this.updateBody.withStorageProfile(storageProfile); - return this; - } - - public VirtualMachineImpl withNetworkProfile(NetworkProfileUpdate networkProfile) { - this.updateBody.withNetworkProfile(networkProfile); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstallPatchesResultImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstallPatchesResultImpl.java deleted file mode 100644 index 6fc1365d24f7..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstallPatchesResultImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.implementation; - -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstallPatchesResultInner; -import com.azure.resourcemanager.connectedvmware.models.ErrorDetail; -import com.azure.resourcemanager.connectedvmware.models.OsTypeUM; -import com.azure.resourcemanager.connectedvmware.models.PatchOperationStartedBy; -import com.azure.resourcemanager.connectedvmware.models.PatchOperationStatus; -import com.azure.resourcemanager.connectedvmware.models.PatchServiceUsed; -import com.azure.resourcemanager.connectedvmware.models.VMGuestPatchRebootStatus; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstallPatchesResult; -import java.time.OffsetDateTime; - -public final class VirtualMachineInstallPatchesResultImpl implements VirtualMachineInstallPatchesResult { - private VirtualMachineInstallPatchesResultInner innerObject; - - private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; - - VirtualMachineInstallPatchesResultImpl( - VirtualMachineInstallPatchesResultInner innerObject, - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public PatchOperationStatus status() { - return this.innerModel().status(); - } - - public String installationActivityId() { - return this.innerModel().installationActivityId(); - } - - public VMGuestPatchRebootStatus rebootStatus() { - return this.innerModel().rebootStatus(); - } - - public Boolean maintenanceWindowExceeded() { - return this.innerModel().maintenanceWindowExceeded(); - } - - public Integer excludedPatchCount() { - return this.innerModel().excludedPatchCount(); - } - - public Integer notSelectedPatchCount() { - return this.innerModel().notSelectedPatchCount(); - } - - public Integer pendingPatchCount() { - return this.innerModel().pendingPatchCount(); - } - - public Integer installedPatchCount() { - return this.innerModel().installedPatchCount(); - } - - public Integer failedPatchCount() { - return this.innerModel().failedPatchCount(); - } - - public OffsetDateTime startDateTime() { - return this.innerModel().startDateTime(); - } - - public OffsetDateTime lastModifiedDateTime() { - return this.innerModel().lastModifiedDateTime(); - } - - public PatchOperationStartedBy startedBy() { - return this.innerModel().startedBy(); - } - - public PatchServiceUsed patchServiceUsed() { - return this.innerModel().patchServiceUsed(); - } - - public OsTypeUM osType() { - return this.innerModel().osType(); - } - - public ErrorDetail errorDetails() { - return this.innerModel().errorDetails(); - } - - public VirtualMachineInstallPatchesResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstanceImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstanceImpl.java new file mode 100644 index 000000000000..6e48b91f00d0 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstanceImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; +import com.azure.resourcemanager.connectedvmware.models.InfrastructureProfile; +import com.azure.resourcemanager.connectedvmware.models.NetworkProfile; +import com.azure.resourcemanager.connectedvmware.models.OsProfileForVMInstance; +import com.azure.resourcemanager.connectedvmware.models.PlacementProfile; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; +import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; +import com.azure.resourcemanager.connectedvmware.models.SecurityProfile; +import com.azure.resourcemanager.connectedvmware.models.StorageProfile; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstance; +import java.util.Collections; +import java.util.List; + +public final class VirtualMachineInstanceImpl implements VirtualMachineInstance { + private VirtualMachineInstanceInner innerObject; + + private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; + + VirtualMachineInstanceImpl( + VirtualMachineInstanceInner innerObject, + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PlacementProfile placementProfile() { + return this.innerModel().placementProfile(); + } + + public OsProfileForVMInstance osProfile() { + return this.innerModel().osProfile(); + } + + public HardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public InfrastructureProfile infrastructureProfile() { + return this.innerModel().infrastructureProfile(); + } + + public String powerState() { + return this.innerModel().powerState(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceUid() { + return this.innerModel().resourceUid(); + } + + public VirtualMachineInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstancesClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstancesClientImpl.java new file mode 100644 index 000000000000..b03a683156ac --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstancesClientImpl.java @@ -0,0 +1,2081 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.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.connectedvmware.fluent.VirtualMachineInstancesClient; +import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstanceUpdate; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstancesList; +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 VirtualMachineInstancesClient. */ +public final class VirtualMachineInstancesClientImpl implements VirtualMachineInstancesClient { + /** The proxy service used to perform REST calls. */ + private final VirtualMachineInstancesService service; + + /** The service client containing this operation class. */ + private final ConnectedVMwareClientImpl client; + + /** + * Initializes an instance of VirtualMachineInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineInstancesClientImpl(ConnectedVMwareClientImpl client) { + this.service = + RestProxy + .create(VirtualMachineInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ConnectedVMwareClientVirtualMachineInstances to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ConnectedVMwareClien") + public interface VirtualMachineInstancesService { + @Headers({"Content-Type: application/json"}) + @Put("/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualMachineInstanceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualMachineInstanceUpdate body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @QueryParam("deleteFromHost") Boolean deleteFromHost, + @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/stop") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StopVirtualMachineOptions body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/start") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/restart") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceUri, VirtualMachineInstanceInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceUri, VirtualMachineInstanceInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginCreateOrUpdateAsync( + String resourceUri, VirtualMachineInstanceInner body) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceUri, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginCreateOrUpdateAsync( + String resourceUri) { + final VirtualMachineInstanceInner body = null; + Mono>> mono = createOrUpdateWithResponseAsync(resourceUri, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginCreateOrUpdateAsync( + String resourceUri, VirtualMachineInstanceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceUri, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + context); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginCreateOrUpdate( + String resourceUri) { + final VirtualMachineInstanceInner body = null; + return this.beginCreateOrUpdateAsync(resourceUri, body).getSyncPoller(); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginCreateOrUpdate( + String resourceUri, VirtualMachineInstanceInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceUri, VirtualMachineInstanceInner body) { + return beginCreateOrUpdateAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceUri) { + final VirtualMachineInstanceInner body = null; + return beginCreateOrUpdateAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceUri, VirtualMachineInstanceInner body, Context context) { + return beginCreateOrUpdateAsync(resourceUri, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner createOrUpdate(String resourceUri) { + final VirtualMachineInstanceInner body = null; + return createOrUpdateAsync(resourceUri, body).block(); + } + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner createOrUpdate( + String resourceUri, VirtualMachineInstanceInner body, Context context) { + return createOrUpdateAsync(resourceUri, body, context).block(); + } + + /** + * Gets a virtual machine. + * + *

Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine. + * + *

Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * Gets a virtual machine. + * + *

Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a virtual machine. + * + *

Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Gets a virtual machine. + * + *

Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceUri, VirtualMachineInstanceUpdate body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceUri, VirtualMachineInstanceUpdate body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginUpdateAsync( + String resourceUri, VirtualMachineInstanceUpdate body) { + Mono>> mono = updateWithResponseAsync(resourceUri, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginUpdateAsync( + String resourceUri) { + final VirtualMachineInstanceUpdate body = null; + Mono>> mono = updateWithResponseAsync(resourceUri, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> beginUpdateAsync( + String resourceUri, VirtualMachineInstanceUpdate body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceUri, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstanceInner.class, + VirtualMachineInstanceInner.class, + context); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginUpdate( + String resourceUri) { + final VirtualMachineInstanceUpdate body = null; + return this.beginUpdateAsync(resourceUri, body).getSyncPoller(); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> beginUpdate( + String resourceUri, VirtualMachineInstanceUpdate body, Context context) { + return this.beginUpdateAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceUri, VirtualMachineInstanceUpdate body) { + return beginUpdateAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceUri) { + final VirtualMachineInstanceUpdate body = null; + return beginUpdateAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceUri, VirtualMachineInstanceUpdate body, Context context) { + return beginUpdateAsync(resourceUri, body, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner update(String resourceUri) { + final VirtualMachineInstanceUpdate body = null; + return updateAsync(resourceUri, body).block(); + } + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner update(String resourceUri, VirtualMachineInstanceUpdate body, Context context) { + return updateAsync(resourceUri, body, context).block(); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, Boolean deleteFromHost, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + deleteFromHost, + force, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, Boolean deleteFromHost, Boolean force, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceUri, + this.client.getApiVersion(), + deleteFromHost, + force, + accept, + context); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync( + String resourceUri, Boolean deleteFromHost, Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceUri, deleteFromHost, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync(String resourceUri) { + final Boolean deleteFromHost = null; + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceUri, deleteFromHost, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync( + String resourceUri, Boolean deleteFromHost, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceUri, deleteFromHost, force, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDelete(String resourceUri) { + final Boolean deleteFromHost = null; + final Boolean force = null; + return this.beginDeleteAsync(resourceUri, deleteFromHost, force).getSyncPoller(); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDelete( + String resourceUri, Boolean deleteFromHost, Boolean force, Context context) { + return this.beginDeleteAsync(resourceUri, deleteFromHost, force, context).getSyncPoller(); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri, Boolean deleteFromHost, Boolean force) { + return beginDeleteAsync(resourceUri, deleteFromHost, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri) { + final Boolean deleteFromHost = null; + final Boolean force = null; + return beginDeleteAsync(resourceUri, deleteFromHost, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri, Boolean deleteFromHost, Boolean force, Context context) { + return beginDeleteAsync(resourceUri, deleteFromHost, force, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri) { + final Boolean deleteFromHost = null; + final Boolean force = null; + deleteAsync(resourceUri, deleteFromHost, force).block(); + } + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri, Boolean deleteFromHost, Boolean force, Context context) { + deleteAsync(resourceUri, deleteFromHost, force, context).block(); + } + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VirtualMachineInstances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), resourceUri, 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())); + } + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VirtualMachineInstances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VirtualMachineInstances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VirtualMachineInstances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VirtualMachineInstances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VirtualMachineInstances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, StopVirtualMachineOptions body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, StopVirtualMachineOptions body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stop(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), body, accept, context); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, StopVirtualMachineOptions body) { + Mono>> mono = stopWithResponseAsync(resourceUri, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri) { + final StopVirtualMachineOptions body = null; + Mono>> mono = stopWithResponseAsync(resourceUri, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, StopVirtualMachineOptions body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(resourceUri, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri) { + final StopVirtualMachineOptions body = null; + return this.beginStopAsync(resourceUri, body).getSyncPoller(); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, StopVirtualMachineOptions body, Context context) { + return this.beginStopAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri, StopVirtualMachineOptions body) { + return beginStopAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri) { + final StopVirtualMachineOptions body = null; + return beginStopAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri, StopVirtualMachineOptions body, Context context) { + return beginStopAsync(resourceUri, body, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri) { + final StopVirtualMachineOptions body = null; + stopAsync(resourceUri, body).block(); + } + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri, StopVirtualMachineOptions body, Context context) { + stopAsync(resourceUri, body, context).block(); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.start(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.start(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri) { + Mono>> mono = startWithResponseAsync(resourceUri); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceUri, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri) { + return this.beginStartAsync(resourceUri).getSyncPoller(); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, Context context) { + return this.beginStartAsync(resourceUri, context).getSyncPoller(); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri) { + return beginStartAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri, Context context) { + return beginStartAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri) { + startAsync(resourceUri).block(); + } + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri, Context context) { + startAsync(resourceUri, context).block(); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restart(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri) { + Mono>> mono = restartWithResponseAsync(resourceUri); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restartWithResponseAsync(resourceUri, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri) { + return this.beginRestartAsync(resourceUri).getSyncPoller(); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceUri, Context context) { + return this.beginRestartAsync(resourceUri, context).getSyncPoller(); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri) { + return beginRestartAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceUri, Context context) { + return beginRestartAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri) { + restartAsync(resourceUri).block(); + } + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceUri, Context context) { + restartAsync(resourceUri, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualMachineInstances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualMachineInstances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstancesImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstancesImpl.java new file mode 100644 index 000000000000..97f34bf54f97 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineInstancesImpl.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.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.connectedvmware.fluent.VirtualMachineInstancesClient; +import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstance; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstanceUpdate; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstances; + +public final class VirtualMachineInstancesImpl implements VirtualMachineInstances { + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstancesImpl.class); + + private final VirtualMachineInstancesClient innerClient; + + private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; + + public VirtualMachineInstancesImpl( + VirtualMachineInstancesClient innerClient, + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualMachineInstance createOrUpdate(String resourceUri) { + VirtualMachineInstanceInner inner = this.serviceClient().createOrUpdate(resourceUri); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance createOrUpdate( + String resourceUri, VirtualMachineInstanceInner body, Context context) { + VirtualMachineInstanceInner inner = this.serviceClient().createOrUpdate(resourceUri, body, context); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineInstance get(String resourceUri) { + VirtualMachineInstanceInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance update(String resourceUri) { + VirtualMachineInstanceInner inner = this.serviceClient().update(resourceUri); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance update(String resourceUri, VirtualMachineInstanceUpdate body, Context context) { + VirtualMachineInstanceInner inner = this.serviceClient().update(resourceUri, body, context); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceUri) { + this.serviceClient().delete(resourceUri); + } + + public void delete(String resourceUri, Boolean deleteFromHost, Boolean force, Context context) { + this.serviceClient().delete(resourceUri, deleteFromHost, force, context); + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return Utils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); + } + + public void stop(String resourceUri) { + this.serviceClient().stop(resourceUri); + } + + public void stop(String resourceUri, StopVirtualMachineOptions body, Context context) { + this.serviceClient().stop(resourceUri, body, context); + } + + public void start(String resourceUri) { + this.serviceClient().start(resourceUri); + } + + public void start(String resourceUri, Context context) { + this.serviceClient().start(resourceUri, context); + } + + public void restart(String resourceUri) { + this.serviceClient().restart(resourceUri); + } + + public void restart(String resourceUri, Context context) { + this.serviceClient().restart(resourceUri, context); + } + + private VirtualMachineInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplateImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplateImpl.java index c24e263950fb..faa826d44b5c 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplateImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplateImpl.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.connectedvmware.models.FirmwareType; import com.azure.resourcemanager.connectedvmware.models.NetworkInterface; import com.azure.resourcemanager.connectedvmware.models.OsType; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourcePatch; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.azure.resourcemanager.connectedvmware.models.VirtualDisk; @@ -150,7 +151,7 @@ public List statuses() { } } - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplatesClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplatesClientImpl.java index 41017251fcb5..05c2ea2d8373 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplatesClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplatesClientImpl.java @@ -66,11 +66,10 @@ public final class VirtualMachineTemplatesClientImpl implements VirtualMachineTe */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface VirtualMachineTemplatesService { + public interface VirtualMachineTemplatesService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -85,8 +84,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -100,8 +98,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -116,8 +113,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -143,8 +139,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -321,6 +316,34 @@ private PollerFlux, VirtualMachineTempla this.client.getContext()); } + /** + * Implements virtual machine template PUT method. + * + *

Create Or Update virtual machine template. + * + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the virtualMachineTemplate. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineTemplateInner> beginCreateAsync( + String resourceGroupName, String virtualMachineTemplateName) { + final VirtualMachineTemplateInner body = null; + Mono>> mono = + createWithResponseAsync(resourceGroupName, virtualMachineTemplateName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineTemplateInner.class, + VirtualMachineTemplateInner.class, + this.client.getContext()); + } + /** * Implements virtual machine template PUT method. * @@ -361,7 +384,6 @@ private PollerFlux, VirtualMachineTempla * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -369,8 +391,9 @@ private PollerFlux, VirtualMachineTempla */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualMachineTemplateInner> beginCreate( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body) { - return beginCreateAsync(resourceGroupName, virtualMachineTemplateName, body).getSyncPoller(); + String resourceGroupName, String virtualMachineTemplateName) { + final VirtualMachineTemplateInner body = null; + return this.beginCreateAsync(resourceGroupName, virtualMachineTemplateName, body).getSyncPoller(); } /** @@ -393,7 +416,7 @@ public SyncPoller, VirtualMachineTemplat String virtualMachineTemplateName, VirtualMachineTemplateInner body, Context context) { - return beginCreateAsync(resourceGroupName, virtualMachineTemplateName, body, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, virtualMachineTemplateName, body, context).getSyncPoller(); } /** @@ -462,25 +485,6 @@ private Mono createAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Implements virtual machine template PUT method. - * - *

Create Or Update virtual machine template. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachineTemplate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineTemplateInner create( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body) { - return createAsync(resourceGroupName, virtualMachineTemplateName, body).block(); - } - /** * Implements virtual machine template PUT method. * @@ -652,14 +656,16 @@ private Mono getByResourceGroupAsync( * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachineTemplate. + * @return define the virtualMachineTemplate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineTemplateInner getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName) { - return getByResourceGroupAsync(resourceGroupName, virtualMachineTemplateName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualMachineTemplateName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineTemplateName, context).block(); } /** @@ -669,16 +675,14 @@ public VirtualMachineTemplateInner getByResourceGroup(String resourceGroupName, * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachineTemplate along with {@link Response}. + * @return define the virtualMachineTemplate. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineTemplateName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineTemplateName, context).block(); + public VirtualMachineTemplateInner getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName) { + return getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, Context.NONE).getValue(); } /** @@ -802,15 +806,14 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param body Resource properties to update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the virtualMachineTemplate on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body) { + private Mono updateAsync(String resourceGroupName, String virtualMachineTemplateName) { + final ResourcePatch body = null; return updateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -822,16 +825,17 @@ private Mono updateAsync( * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @param body Resource properties to update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachineTemplate on successful completion of {@link Mono}. + * @return define the virtualMachineTemplate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String virtualMachineTemplateName) { - final ResourcePatch body = null; - return updateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response updateWithResponse( + String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, body, context).block(); } /** @@ -849,27 +853,7 @@ private Mono updateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public VirtualMachineTemplateInner update(String resourceGroupName, String virtualMachineTemplateName) { final ResourcePatch body = null; - return updateAsync(resourceGroupName, virtualMachineTemplateName, body).block(); - } - - /** - * Updates a virtual machine template. - * - *

API to update certain properties of the virtual machine template resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachineTemplate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context) { - return updateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, body, context).block(); + return updateWithResponse(resourceGroupName, virtualMachineTemplateName, body, Context.NONE).getValue(); } /** @@ -1004,6 +988,30 @@ private PollerFlux, Void> beginDeleteAsync( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } + /** + * Deletes an virtual machine template. + * + *

Implements virtual machine template DELETE method. + * + * @param resourceGroupName The Resource Group Name. + * @param virtualMachineTemplateName Name of the virtual machine template resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String virtualMachineTemplateName) { + final Boolean force = null; + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualMachineTemplateName, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + /** * Deletes an virtual machine template. * @@ -1036,16 +1044,15 @@ private PollerFlux, Void> beginDeleteAsync( * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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> beginDelete( - String resourceGroupName, String virtualMachineTemplateName, Boolean force) { - return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineTemplateName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force).getSyncPoller(); } /** @@ -1065,7 +1072,7 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force, context).getSyncPoller(); } /** @@ -1130,23 +1137,6 @@ private Mono deleteAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes an virtual machine template. - * - *

Implements virtual machine template DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param force Whether force delete was specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 virtualMachineTemplateName, Boolean force) { - deleteAsync(resourceGroupName, virtualMachineTemplateName, force).block(); - } - /** * Deletes an virtual machine template. * @@ -1517,7 +1507,8 @@ public PagedIterable listByResourceGroup(String res /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1553,7 +1544,8 @@ private Mono> listNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1590,7 +1582,8 @@ private Mono> listNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1627,7 +1620,8 @@ private Mono> listByResourceGroupNext /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplatesImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplatesImpl.java index 7447ea392ab4..958292009e9f 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplatesImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachineTemplatesImpl.java @@ -28,16 +28,6 @@ public VirtualMachineTemplatesImpl( this.serviceManager = serviceManager; } - public VirtualMachineTemplate getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName) { - VirtualMachineTemplateInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, virtualMachineTemplateName); - if (inner != null) { - return new VirtualMachineTemplateImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String virtualMachineTemplateName, Context context) { Response inner = @@ -53,8 +43,14 @@ public Response getByResourceGroupWithResponse( } } - public void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force) { - this.serviceClient().delete(resourceGroupName, virtualMachineTemplateName, force); + public VirtualMachineTemplate getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName) { + VirtualMachineTemplateInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, virtualMachineTemplateName); + if (inner != null) { + return new VirtualMachineTemplateImpl(inner, this.manager()); + } else { + return null; + } } public void delete(String resourceGroupName, String virtualMachineTemplateName) { diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachinesClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachinesClientImpl.java deleted file mode 100644 index ad429362adb2..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachinesClientImpl.java +++ /dev/null @@ -1,3203 +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.connectedvmware.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.connectedvmware.fluent.VirtualMachinesClient; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineAssessPatchesResultInner; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstallPatchesResultInner; -import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstallPatchesParameters; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineUpdate; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachinesList; -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 VirtualMachinesClient. */ -public final class VirtualMachinesClientImpl implements VirtualMachinesClient { - /** The proxy service used to perform REST calls. */ - private final VirtualMachinesService service; - - /** The service client containing this operation class. */ - private final ConnectedVMwareClientImpl client; - - /** - * Initializes an instance of VirtualMachinesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachinesClientImpl(ConnectedVMwareClientImpl client) { - this.service = - RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ConnectedVMwareClientVirtualMachines to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ConnectedVMwareClien") - private interface VirtualMachinesService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/assessPatches") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> assessPatches( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/installPatches") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> installPatches( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @BodyParam("application/json") VirtualMachineInstallPatchesParameters installPatchesInput, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualMachineInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualMachineUpdate body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @QueryParam("force") Boolean force, - @QueryParam("retain") Boolean retain, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StopVirtualMachineOptions body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/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( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/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("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @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); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> assessPatchesWithResponseAsync(String resourceGroupName, String name) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .assessPatches( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> assessPatchesWithResponseAsync( - String resourceGroupName, String name, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .assessPatches( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - accept, - context); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineAssessPatchesResultInner> - beginAssessPatchesAsync(String resourceGroupName, String name) { - Mono>> mono = assessPatchesWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineAssessPatchesResultInner.class, - VirtualMachineAssessPatchesResultInner.class, - this.client.getContext()); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineAssessPatchesResultInner> - beginAssessPatchesAsync(String resourceGroupName, String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = assessPatchesWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineAssessPatchesResultInner.class, - VirtualMachineAssessPatchesResultInner.class, - context); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineAssessPatchesResultInner> - beginAssessPatches(String resourceGroupName, String name) { - return beginAssessPatchesAsync(resourceGroupName, name).getSyncPoller(); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineAssessPatchesResultInner> - beginAssessPatches(String resourceGroupName, String name, Context context) { - return beginAssessPatchesAsync(resourceGroupName, name, context).getSyncPoller(); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono assessPatchesAsync(String resourceGroupName, String name) { - return beginAssessPatchesAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono assessPatchesAsync( - String resourceGroupName, String name, Context context) { - return beginAssessPatchesAsync(resourceGroupName, name, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineAssessPatchesResultInner assessPatches(String resourceGroupName, String name) { - return assessPatchesAsync(resourceGroupName, name).block(); - } - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineAssessPatchesResultInner assessPatches( - String resourceGroupName, String name, Context context) { - return assessPatchesAsync(resourceGroupName, name, context).block(); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result summary of an installation operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> installPatchesWithResponseAsync( - String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (installPatchesInput == null) { - return Mono - .error(new IllegalArgumentException("Parameter installPatchesInput is required and cannot be null.")); - } else { - installPatchesInput.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .installPatches( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - installPatchesInput, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result summary of an installation operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> installPatchesWithResponseAsync( - String resourceGroupName, - String name, - VirtualMachineInstallPatchesParameters installPatchesInput, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (installPatchesInput == null) { - return Mono - .error(new IllegalArgumentException("Parameter installPatchesInput is required and cannot be null.")); - } else { - installPatchesInput.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .installPatches( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - installPatchesInput, - accept, - context); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInstallPatchesResultInner> - beginInstallPatchesAsync( - String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput) { - Mono>> mono = - installPatchesWithResponseAsync(resourceGroupName, name, installPatchesInput); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineInstallPatchesResultInner.class, - VirtualMachineInstallPatchesResultInner.class, - this.client.getContext()); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInstallPatchesResultInner> - beginInstallPatchesAsync( - String resourceGroupName, - String name, - VirtualMachineInstallPatchesParameters installPatchesInput, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - installPatchesWithResponseAsync(resourceGroupName, name, installPatchesInput, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineInstallPatchesResultInner.class, - VirtualMachineInstallPatchesResultInner.class, - context); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInstallPatchesResultInner> - beginInstallPatches( - String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput) { - return beginInstallPatchesAsync(resourceGroupName, name, installPatchesInput).getSyncPoller(); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInstallPatchesResultInner> - beginInstallPatches( - String resourceGroupName, - String name, - VirtualMachineInstallPatchesParameters installPatchesInput, - Context context) { - return beginInstallPatchesAsync(resourceGroupName, name, installPatchesInput, context).getSyncPoller(); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result summary of an installation operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono installPatchesAsync( - String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput) { - return beginInstallPatchesAsync(resourceGroupName, name, installPatchesInput) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result summary of an installation operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono installPatchesAsync( - String resourceGroupName, - String name, - VirtualMachineInstallPatchesParameters installPatchesInput, - Context context) { - return beginInstallPatchesAsync(resourceGroupName, name, installPatchesInput, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInstallPatchesResultInner installPatches( - String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput) { - return installPatchesAsync(resourceGroupName, name, installPatchesInput).block(); - } - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result summary of an installation operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInstallPatchesResultInner installPatches( - String resourceGroupName, - String name, - VirtualMachineInstallPatchesParameters installPatchesInput, - Context context) { - return installPatchesAsync(resourceGroupName, name, installPatchesInput, context).block(); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - body, - accept, - context); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInner> beginCreateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - Mono>> mono = createWithResponseAsync(resourceGroupName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineInner.class, - VirtualMachineInner.class, - this.client.getContext()); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInner> beginCreateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, virtualMachineName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInner> beginCreate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - return beginCreateAsync(resourceGroupName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInner> beginCreate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context) { - return beginCreateAsync(resourceGroupName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - return beginCreateAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String virtualMachineName) { - final VirtualMachineInner body = null; - return beginCreateAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context) { - return beginCreateAsync(resourceGroupName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner create(String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - return createAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner create(String resourceGroupName, String virtualMachineName) { - final VirtualMachineInner body = null; - return createAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Implements virtual machine PUT method. - * - *

Create Or Update virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner create( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context) { - return createAsync(resourceGroupName, virtualMachineName, body, context).block(); - } - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualMachineName) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName 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, - virtualMachineName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String virtualMachineName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner getByResourceGroup(String resourceGroupName, String virtualMachineName) { - return getByResourceGroupAsync(resourceGroupName, virtualMachineName).block(); - } - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - body, - accept, - context); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInner> beginUpdateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineInner.class, - VirtualMachineInner.class, - this.client.getContext()); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInner> beginUpdateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, virtualMachineName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - return beginUpdateAsync(resourceGroupName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - return beginUpdateAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String virtualMachineName) { - final VirtualMachineUpdate body = null; - return beginUpdateAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner update(String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - return updateAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner update(String resourceGroupName, String virtualMachineName) { - final VirtualMachineUpdate body = null; - return updateAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Updates a virtual machine. - * - *

API to update certain properties of the virtual machine resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner update( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - return updateAsync(resourceGroupName, virtualMachineName, body, context).block(); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, Boolean force, Boolean retain) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - force, - retain, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, Boolean force, Boolean retain, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName 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, - virtualMachineName, - this.client.getApiVersion(), - force, - retain, - accept, - context); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDeleteAsync( - String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualMachineName, force, retain); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDeleteAsync( - String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualMachineName, force, retain, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDelete( - String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, force, retain).getSyncPoller(); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDelete( - String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain, Context context) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, force, retain, context).getSyncPoller(); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 virtualMachineName, Boolean force, Boolean retain) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, force, retain) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineName) { - final Boolean force = null; - final Boolean retain = null; - return beginDeleteAsync(resourceGroupName, virtualMachineName, force, retain) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 virtualMachineName, Boolean force, Boolean retain, Context context) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, force, retain, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 virtualMachineName, Boolean force, Boolean retain) { - deleteAsync(resourceGroupName, virtualMachineName, force, retain).block(); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineName) { - final Boolean force = null; - final Boolean retain = null; - deleteAsync(resourceGroupName, virtualMachineName, force, retain).block(); - } - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 virtualMachineName, Boolean force, Boolean retain, Context context) { - deleteAsync(resourceGroupName, virtualMachineName, force, retain, context).block(); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, StopVirtualMachineOptions body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, StopVirtualMachineOptions body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - body, - accept, - context); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, StopVirtualMachineOptions body) { - Mono>> mono = stopWithResponseAsync(resourceGroupName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, StopVirtualMachineOptions body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(resourceGroupName, virtualMachineName, body, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, StopVirtualMachineOptions body) { - return beginStopAsync(resourceGroupName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 virtualMachineName, StopVirtualMachineOptions body, Context context) { - return beginStopAsync(resourceGroupName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 virtualMachineName, StopVirtualMachineOptions body) { - return beginStopAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String virtualMachineName) { - final StopVirtualMachineOptions body = null; - return beginStopAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 virtualMachineName, StopVirtualMachineOptions body, Context context) { - return beginStopAsync(resourceGroupName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 virtualMachineName, StopVirtualMachineOptions body) { - stopAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String virtualMachineName) { - final StopVirtualMachineOptions body = null; - stopAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 virtualMachineName, StopVirtualMachineOptions body, Context context) { - stopAsync(resourceGroupName, virtualMachineName, body, context).block(); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String virtualMachineName) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName 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, - virtualMachineName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync(String resourceGroupName, String virtualMachineName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, virtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String virtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, virtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String virtualMachineName) { - return beginStartAsync(resourceGroupName, virtualMachineName).getSyncPoller(); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart( - String resourceGroupName, String virtualMachineName, Context context) { - return beginStartAsync(resourceGroupName, virtualMachineName, context).getSyncPoller(); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String virtualMachineName) { - return beginStartAsync(resourceGroupName, virtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String virtualMachineName, Context context) { - return beginStartAsync(resourceGroupName, virtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String virtualMachineName) { - startAsync(resourceGroupName, virtualMachineName).block(); - } - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String virtualMachineName, Context context) { - startAsync(resourceGroupName, virtualMachineName, context).block(); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String virtualMachineName) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName 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, - virtualMachineName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String virtualMachineName) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, virtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String virtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restartWithResponseAsync(resourceGroupName, virtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestart(String resourceGroupName, String virtualMachineName) { - return beginRestartAsync(resourceGroupName, virtualMachineName).getSyncPoller(); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestart( - String resourceGroupName, String virtualMachineName, Context context) { - return beginRestartAsync(resourceGroupName, virtualMachineName, context).getSyncPoller(); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String virtualMachineName) { - return beginRestartAsync(resourceGroupName, virtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String virtualMachineName, Context context) { - return beginRestartAsync(resourceGroupName, virtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String virtualMachineName) { - restartAsync(resourceGroupName, virtualMachineName).block(); - } - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String virtualMachineName, Context context) { - restartAsync(resourceGroupName, virtualMachineName, context).block(); - } - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines 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 VirtualMachines 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())); - } - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines in a 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 VirtualMachines 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)); - } - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines 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 VirtualMachines as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines in a 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 VirtualMachines as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines 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 VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines in a 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 VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines 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())); - } - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines 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)); - } - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines 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)); - } - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The 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 VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * 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 VirtualMachines 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 VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachinesImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachinesImpl.java deleted file mode 100644 index cb28a2187257..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualMachinesImpl.java +++ /dev/null @@ -1,260 +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.connectedvmware.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.connectedvmware.fluent.VirtualMachinesClient; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineAssessPatchesResultInner; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstallPatchesResultInner; -import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachine; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineAssessPatchesResult; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstallPatchesParameters; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstallPatchesResult; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachines; - -public final class VirtualMachinesImpl implements VirtualMachines { - private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinesImpl.class); - - private final VirtualMachinesClient innerClient; - - private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; - - public VirtualMachinesImpl( - VirtualMachinesClient innerClient, - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name) { - VirtualMachineAssessPatchesResultInner inner = this.serviceClient().assessPatches(resourceGroupName, name); - if (inner != null) { - return new VirtualMachineAssessPatchesResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name, Context context) { - VirtualMachineAssessPatchesResultInner inner = - this.serviceClient().assessPatches(resourceGroupName, name, context); - if (inner != null) { - return new VirtualMachineAssessPatchesResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public VirtualMachineInstallPatchesResult installPatches( - String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput) { - VirtualMachineInstallPatchesResultInner inner = - this.serviceClient().installPatches(resourceGroupName, name, installPatchesInput); - if (inner != null) { - return new VirtualMachineInstallPatchesResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public VirtualMachineInstallPatchesResult installPatches( - String resourceGroupName, - String name, - VirtualMachineInstallPatchesParameters installPatchesInput, - Context context) { - VirtualMachineInstallPatchesResultInner inner = - this.serviceClient().installPatches(resourceGroupName, name, installPatchesInput, context); - if (inner != null) { - return new VirtualMachineInstallPatchesResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName) { - VirtualMachineInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualMachineName); - if (inner != null) { - return new VirtualMachineImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VirtualMachineImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, force, retain); - } - - public void delete(String resourceGroupName, String virtualMachineName) { - this.serviceClient().delete(resourceGroupName, virtualMachineName); - } - - public void delete( - String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain, Context context) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, force, retain, context); - } - - public void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body) { - this.serviceClient().stop(resourceGroupName, virtualMachineName, body); - } - - public void stop(String resourceGroupName, String virtualMachineName) { - this.serviceClient().stop(resourceGroupName, virtualMachineName); - } - - public void stop( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context) { - this.serviceClient().stop(resourceGroupName, virtualMachineName, body, context); - } - - public void start(String resourceGroupName, String virtualMachineName) { - this.serviceClient().start(resourceGroupName, virtualMachineName); - } - - public void start(String resourceGroupName, String virtualMachineName, Context context) { - this.serviceClient().start(resourceGroupName, virtualMachineName, context); - } - - public void restart(String resourceGroupName, String virtualMachineName) { - this.serviceClient().restart(resourceGroupName, virtualMachineName); - } - - public void restart(String resourceGroupName, String virtualMachineName, Context context) { - this.serviceClient().restart(resourceGroupName, virtualMachineName, context); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); - } - - public VirtualMachine 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - Boolean localForce = null; - Boolean localRetain = null; - this.delete(resourceGroupName, virtualMachineName, localForce, localRetain, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Boolean force, Boolean retain, 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 virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - this.delete(resourceGroupName, virtualMachineName, force, retain, context); - } - - private VirtualMachinesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { - return this.serviceManager; - } - - public VirtualMachineImpl define(String name) { - return new VirtualMachineImpl(name, this.manager()); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworkImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworkImpl.java index 73f2634868fd..9d5fe1f34305 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworkImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworkImpl.java @@ -9,6 +9,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualNetworkInner; import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; import com.azure.resourcemanager.connectedvmware.models.ResourcePatch; import com.azure.resourcemanager.connectedvmware.models.ResourceStatus; import com.azure.resourcemanager.connectedvmware.models.VirtualNetwork; @@ -91,7 +92,7 @@ public List statuses() { } } - public String provisioningState() { + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworksClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworksClientImpl.java index eaedc5f5b4eb..b726a91c37aa 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworksClientImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworksClientImpl.java @@ -65,11 +65,10 @@ public final class VirtualNetworksClientImpl implements VirtualNetworksClient { */ @Host("{$host}") @ServiceInterface(name = "ConnectedVMwareClien") - private interface VirtualNetworksService { + public interface VirtualNetworksService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -84,8 +83,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -99,8 +97,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -115,8 +112,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -142,8 +138,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.ConnectedVMwarevSphere/virtualNetworks") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -312,6 +307,33 @@ private PollerFlux, VirtualNetworkInner> beginCr this.client.getContext()); } + /** + * Implements virtual network PUT method. + * + *

Create Or Update virtual network. + * + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the virtualNetwork. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualNetworkInner> beginCreateAsync( + String resourceGroupName, String virtualNetworkName) { + final VirtualNetworkInner body = null; + Mono>> mono = createWithResponseAsync(resourceGroupName, virtualNetworkName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualNetworkInner.class, + VirtualNetworkInner.class, + this.client.getContext()); + } + /** * Implements virtual network PUT method. * @@ -345,7 +367,6 @@ private PollerFlux, VirtualNetworkInner> beginCr * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -353,8 +374,9 @@ private PollerFlux, VirtualNetworkInner> beginCr */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualNetworkInner> beginCreate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body) { - return beginCreateAsync(resourceGroupName, virtualNetworkName, body).getSyncPoller(); + String resourceGroupName, String virtualNetworkName) { + final VirtualNetworkInner body = null; + return this.beginCreateAsync(resourceGroupName, virtualNetworkName, body).getSyncPoller(); } /** @@ -374,7 +396,7 @@ public SyncPoller, VirtualNetworkInner> beginCre @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualNetworkInner> beginCreate( String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context) { - return beginCreateAsync(resourceGroupName, virtualNetworkName, body, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, virtualNetworkName, body, context).getSyncPoller(); } /** @@ -440,24 +462,6 @@ private Mono createAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Implements virtual network PUT method. - * - *

Create Or Update virtual network. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualNetworkName Name of the virtual network resource. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualNetwork. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner create(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body) { - return createAsync(resourceGroupName, virtualNetworkName, body).block(); - } - /** * Implements virtual network PUT method. * @@ -621,14 +625,16 @@ private Mono getByResourceGroupAsync(String resourceGroupNa * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualNetwork. + * @return define the virtualNetwork along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { - return getByResourceGroupAsync(resourceGroupName, virtualNetworkName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, context).block(); } /** @@ -638,16 +644,14 @@ public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String v * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualNetwork along with {@link Response}. + * @return define the virtualNetwork. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, context).block(); + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, Context.NONE).getValue(); } /** @@ -767,15 +771,14 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. - * @param body Resource properties to update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the virtualNetwork on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualNetworkName, ResourcePatch body) { + private Mono updateAsync(String resourceGroupName, String virtualNetworkName) { + final ResourcePatch body = null; return updateWithResponseAsync(resourceGroupName, virtualNetworkName, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -787,16 +790,17 @@ private Mono updateAsync( * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. + * @param body Resource properties to update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualNetwork on successful completion of {@link Mono}. + * @return define the virtualNetwork along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String virtualNetworkName) { - final ResourcePatch body = null; - return updateWithResponseAsync(resourceGroupName, virtualNetworkName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response updateWithResponse( + String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, virtualNetworkName, body, context).block(); } /** @@ -814,27 +818,7 @@ private Mono updateAsync(String resourceGroupName, String v @ServiceMethod(returns = ReturnType.SINGLE) public VirtualNetworkInner update(String resourceGroupName, String virtualNetworkName) { final ResourcePatch body = null; - return updateAsync(resourceGroupName, virtualNetworkName, body).block(); - } - - /** - * Updates a virtual network. - * - *

API to update certain properties of the virtual network resource. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualNetworkName Name of the virtual network resource. - * @param body Resource properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualNetwork along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context) { - return updateWithResponseAsync(resourceGroupName, virtualNetworkName, body, context).block(); + return updateWithResponse(resourceGroupName, virtualNetworkName, body, Context.NONE).getValue(); } /** @@ -964,6 +948,28 @@ private PollerFlux, Void> beginDeleteAsync( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } + /** + * Deletes an virtual network. + * + *

Implements virtual network DELETE method. + * + * @param resourceGroupName The Resource Group Name. + * @param virtualNetworkName Name of the virtual network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + /** * Deletes an virtual network. * @@ -996,16 +1002,15 @@ private PollerFlux, Void> beginDeleteAsync( * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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> beginDelete( - String resourceGroupName, String virtualNetworkName, Boolean force) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, force).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName, force).getSyncPoller(); } /** @@ -1025,7 +1030,7 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String virtualNetworkName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, force, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName, force, context).getSyncPoller(); } /** @@ -1090,23 +1095,6 @@ private Mono deleteAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes an virtual network. - * - *

Implements virtual network DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualNetworkName Name of the virtual network resource. - * @param force Whether force delete was specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 virtualNetworkName, Boolean force) { - deleteAsync(resourceGroupName, virtualNetworkName, force).block(); - } - /** * Deletes an virtual network. * @@ -1472,7 +1460,8 @@ public PagedIterable listByResourceGroup(String resourceGro /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1507,7 +1496,8 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1543,7 +1533,8 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1579,7 +1570,8 @@ private Mono> listByResourceGroupNextSinglePa /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworksImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworksImpl.java index 07d175a9f98b..238a16eefd65 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworksImpl.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VirtualNetworksImpl.java @@ -28,15 +28,6 @@ public VirtualNetworksImpl( this.serviceManager = serviceManager; } - public VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName) { - VirtualNetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkName); - if (inner != null) { - return new VirtualNetworkImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String virtualNetworkName, Context context) { Response inner = @@ -52,8 +43,13 @@ public Response getByResourceGroupWithResponse( } } - public void delete(String resourceGroupName, String virtualNetworkName, Boolean force) { - this.serviceClient().delete(resourceGroupName, virtualNetworkName, force); + public VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + VirtualNetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkName); + if (inner != null) { + return new VirtualNetworkImpl(inner, this.manager()); + } else { + return null; + } } public void delete(String resourceGroupName, String virtualNetworkName) { diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VmInstanceHybridIdentityMetadataImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VmInstanceHybridIdentityMetadataImpl.java new file mode 100644 index 000000000000..1ee525a2e8ba --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VmInstanceHybridIdentityMetadataImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.connectedvmware.fluent.models.VmInstanceHybridIdentityMetadataInner; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningState; +import com.azure.resourcemanager.connectedvmware.models.VmInstanceHybridIdentityMetadata; + +public final class VmInstanceHybridIdentityMetadataImpl implements VmInstanceHybridIdentityMetadata { + private VmInstanceHybridIdentityMetadataInner innerObject; + + private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; + + VmInstanceHybridIdentityMetadataImpl( + VmInstanceHybridIdentityMetadataInner innerObject, + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceUid() { + return this.innerModel().resourceUid(); + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VmInstanceHybridIdentityMetadataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VmInstanceHybridIdentityMetadatasClientImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VmInstanceHybridIdentityMetadatasClientImpl.java new file mode 100644 index 000000000000..c461aae782fb --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VmInstanceHybridIdentityMetadatasClientImpl.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.connectedvmware.fluent.VmInstanceHybridIdentityMetadatasClient; +import com.azure.resourcemanager.connectedvmware.fluent.models.VmInstanceHybridIdentityMetadataInner; +import com.azure.resourcemanager.connectedvmware.models.VmInstanceHybridIdentityMetadataList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in VmInstanceHybridIdentityMetadatasClient. + */ +public final class VmInstanceHybridIdentityMetadatasClientImpl implements VmInstanceHybridIdentityMetadatasClient { + /** The proxy service used to perform REST calls. */ + private final VmInstanceHybridIdentityMetadatasService service; + + /** The service client containing this operation class. */ + private final ConnectedVMwareClientImpl client; + + /** + * Initializes an instance of VmInstanceHybridIdentityMetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VmInstanceHybridIdentityMetadatasClientImpl(ConnectedVMwareClientImpl client) { + this.service = + RestProxy + .create( + VmInstanceHybridIdentityMetadatasService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ConnectedVMwareClientVmInstanceHybridIdentityMetadatas to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ConnectedVMwareClien") + public interface VmInstanceHybridIdentityMetadatasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/hybridIdentityMetadata/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/{resourceUri}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/hybridIdentityMetadata") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VmInstanceHybridIdentityMetadataInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), resourceUri, 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())); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 HybridIdentityMetadata as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 HybridIdentityMetadata as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HybridIdentityMetadata along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VmInstanceHybridIdentityMetadatasImpl.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VmInstanceHybridIdentityMetadatasImpl.java new file mode 100644 index 000000000000..bd0693353c9d --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/implementation/VmInstanceHybridIdentityMetadatasImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.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.connectedvmware.fluent.VmInstanceHybridIdentityMetadatasClient; +import com.azure.resourcemanager.connectedvmware.fluent.models.VmInstanceHybridIdentityMetadataInner; +import com.azure.resourcemanager.connectedvmware.models.VmInstanceHybridIdentityMetadata; +import com.azure.resourcemanager.connectedvmware.models.VmInstanceHybridIdentityMetadatas; + +public final class VmInstanceHybridIdentityMetadatasImpl implements VmInstanceHybridIdentityMetadatas { + private static final ClientLogger LOGGER = new ClientLogger(VmInstanceHybridIdentityMetadatasImpl.class); + + private final VmInstanceHybridIdentityMetadatasClient innerClient; + + private final com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager; + + public VmInstanceHybridIdentityMetadatasImpl( + VmInstanceHybridIdentityMetadatasClient innerClient, + com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VmInstanceHybridIdentityMetadataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VmInstanceHybridIdentityMetadata get(String resourceUri) { + VmInstanceHybridIdentityMetadataInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new VmInstanceHybridIdentityMetadataImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return Utils.mapPage(inner, inner1 -> new VmInstanceHybridIdentityMetadataImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return Utils.mapPage(inner, inner1 -> new VmInstanceHybridIdentityMetadataImpl(inner1, this.manager())); + } + + private VmInstanceHybridIdentityMetadatasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/AvailablePatchCountByClassification.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/AvailablePatchCountByClassification.java deleted file mode 100644 index 5c47ec826be7..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/AvailablePatchCountByClassification.java +++ /dev/null @@ -1,155 +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.connectedvmware.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Summarization of patches available for installation on the machine by classification. */ -@Immutable -public final class AvailablePatchCountByClassification { - /* - * Number of security patches available for installation. - */ - @JsonProperty(value = "security", access = JsonProperty.Access.WRITE_ONLY) - private Integer security; - - /* - * Number of critical patches available for installation. - */ - @JsonProperty(value = "critical", access = JsonProperty.Access.WRITE_ONLY) - private Integer critical; - - /* - * Number of definition patches available for installation. - */ - @JsonProperty(value = "definition", access = JsonProperty.Access.WRITE_ONLY) - private Integer definition; - - /* - * Number of update Rollup patches available for installation. - */ - @JsonProperty(value = "updateRollup", access = JsonProperty.Access.WRITE_ONLY) - private Integer updateRollup; - - /* - * Number of feature pack patches available for installation. - */ - @JsonProperty(value = "featurePack", access = JsonProperty.Access.WRITE_ONLY) - private Integer featurePack; - - /* - * Number of service pack patches available for installation. - */ - @JsonProperty(value = "servicePack", access = JsonProperty.Access.WRITE_ONLY) - private Integer servicePack; - - /* - * Number of tools patches available for installation. - */ - @JsonProperty(value = "tools", access = JsonProperty.Access.WRITE_ONLY) - private Integer tools; - - /* - * Number of updates category patches available for installation. - */ - @JsonProperty(value = "updates", access = JsonProperty.Access.WRITE_ONLY) - private Integer updates; - - /* - * Number of other patches available for installation. - */ - @JsonProperty(value = "other", access = JsonProperty.Access.WRITE_ONLY) - private Integer other; - - /** - * Get the security property: Number of security patches available for installation. - * - * @return the security value. - */ - public Integer security() { - return this.security; - } - - /** - * Get the critical property: Number of critical patches available for installation. - * - * @return the critical value. - */ - public Integer critical() { - return this.critical; - } - - /** - * Get the definition property: Number of definition patches available for installation. - * - * @return the definition value. - */ - public Integer definition() { - return this.definition; - } - - /** - * Get the updateRollup property: Number of update Rollup patches available for installation. - * - * @return the updateRollup value. - */ - public Integer updateRollup() { - return this.updateRollup; - } - - /** - * Get the featurePack property: Number of feature pack patches available for installation. - * - * @return the featurePack value. - */ - public Integer featurePack() { - return this.featurePack; - } - - /** - * Get the servicePack property: Number of service pack patches available for installation. - * - * @return the servicePack value. - */ - public Integer servicePack() { - return this.servicePack; - } - - /** - * Get the tools property: Number of tools patches available for installation. - * - * @return the tools value. - */ - public Integer tools() { - return this.tools; - } - - /** - * Get the updates property: Number of updates category patches available for installation. - * - * @return the updates value. - */ - public Integer updates() { - return this.updates; - } - - /** - * Get the other property: Number of other patches available for installation. - * - * @return the other value. - */ - public Integer other() { - return this.other; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Cluster.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Cluster.java index 92f4aeca140d..657459a0d794 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Cluster.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Cluster.java @@ -121,25 +121,53 @@ public interface Cluster { String customResourceName(); /** - * Gets the datastoreIds property: Gets or sets the datastore ARM ids. + * Gets the usedMemoryGB property: Gets the used physical memory on the cluster in GB. + * + * @return the usedMemoryGB value. + */ + Long usedMemoryGB(); + + /** + * Gets the totalMemoryGB property: Gets the total amount of physical memory on the cluster in GB. + * + * @return the totalMemoryGB value. + */ + Long totalMemoryGB(); + + /** + * Gets the usedCpuMHz property: Gets the used CPU usage across all cores on the cluster in MHz. + * + * @return the usedCpuMHz value. + */ + Long usedCpuMHz(); + + /** + * Gets the totalCpuMHz property: Gets the max CPU usage across all cores on the cluster in MHz. + * + * @return the totalCpuMHz value. + */ + Long totalCpuMHz(); + + /** + * Gets the datastoreIds property: Gets the datastore ARM ids. * * @return the datastoreIds value. */ List datastoreIds(); /** - * Gets the networkIds property: Gets or sets the network ARM ids. + * Gets the networkIds property: Gets the network ARM ids. * * @return the networkIds value. */ List networkIds(); /** - * Gets the provisioningState property: Gets or sets the provisioning state. + * Gets the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - String provisioningState(); + ProvisioningState provisioningState(); /** * Gets the region of the resource. @@ -176,11 +204,13 @@ interface Definition 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 { /** @@ -199,6 +229,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the Cluster definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -209,6 +240,7 @@ interface WithResourceGroup { */ 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. @@ -235,6 +267,7 @@ interface WithCreate */ Cluster create(Context context); } + /** The stage of the Cluster definition allowing to specify tags. */ interface WithTags { /** @@ -245,6 +278,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Cluster definition allowing to specify extendedLocation. */ interface WithExtendedLocation { /** @@ -255,6 +289,7 @@ interface WithExtendedLocation { */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** The stage of the Cluster definition allowing to specify kind. */ interface WithKind { /** @@ -269,6 +304,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the Cluster definition allowing to specify vCenterId. */ interface WithVCenterId { /** @@ -280,6 +316,7 @@ interface WithVCenterId { */ WithCreate withVCenterId(String vCenterId); } + /** The stage of the Cluster definition allowing to specify moRefId. */ interface WithMoRefId { /** @@ -291,6 +328,7 @@ interface WithMoRefId { */ WithCreate withMoRefId(String moRefId); } + /** The stage of the Cluster definition allowing to specify inventoryItemId. */ interface WithInventoryItemId { /** @@ -302,6 +340,7 @@ interface WithInventoryItemId { WithCreate withInventoryItemId(String inventoryItemId); } } + /** * Begins update for the Cluster resource. * @@ -326,6 +365,7 @@ interface Update extends UpdateStages.WithTags { */ Cluster apply(Context context); } + /** The Cluster update stages. */ interface UpdateStages { /** The stage of the Cluster update allowing to specify tags. */ @@ -339,6 +379,7 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ClusterInventoryItem.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ClusterInventoryItem.java index afb54a823f20..e091a411e325 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ClusterInventoryItem.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ClusterInventoryItem.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.connectedvmware.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -14,6 +13,10 @@ @JsonTypeName("Cluster") @Fluent public final class ClusterInventoryItem extends InventoryItemProperties { + /** Creates an instance of ClusterInventoryItem class. */ + public ClusterInventoryItem() { + } + /** {@inheritDoc} */ @Override public ClusterInventoryItem withManagedResourceId(String managedResourceId) { diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Clusters.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Clusters.java index 9cc7b6332597..5293d9fd2a50 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Clusters.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Clusters.java @@ -10,20 +10,6 @@ /** Resource collection API of Clusters. */ public interface Clusters { - /** - * Gets a cluster. - * - *

Implements cluster GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param clusterName 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 define the cluster. - */ - Cluster getByResourceGroup(String resourceGroupName, String clusterName); - /** * Gets a cluster. * @@ -40,18 +26,18 @@ public interface Clusters { Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); /** - * Deletes an cluster. + * Gets a cluster. * - *

Implements cluster DELETE method. + *

Implements cluster GET method. * * @param resourceGroupName The Resource Group Name. * @param clusterName Name of the cluster. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the cluster. */ - void delete(String resourceGroupName, String clusterName, Boolean force); + Cluster getByResourceGroup(String resourceGroupName, String clusterName); /** * Deletes an cluster. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ClustersList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ClustersList.java index 700d7025a85e..4ed3ecbc5c82 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ClustersList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ClustersList.java @@ -25,6 +25,10 @@ public final class ClustersList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of ClustersList class. */ + public ClustersList() { + } + /** * Get the nextLink property: Url to follow for getting next page of Clusters. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Datastore.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Datastore.java index 144fcdd2f849..f95ec2507c2d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Datastore.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Datastore.java @@ -120,6 +120,20 @@ public interface Datastore { */ String customResourceName(); + /** + * Gets the capacityGB property: Gets or sets Maximum capacity of this datastore in GBs. + * + * @return the capacityGB value. + */ + Long capacityGB(); + + /** + * Gets the freeSpaceGB property: Gets or sets Available space of this datastore in GBs. + * + * @return the freeSpaceGB value. + */ + Long freeSpaceGB(); + /** * Gets the provisioningState property: Provisioning state of the resource. * @@ -162,11 +176,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The Datastore definition stages. */ interface DefinitionStages { /** The first stage of the Datastore definition. */ interface Blank extends WithLocation { } + /** The stage of the Datastore definition allowing to specify location. */ interface WithLocation { /** @@ -185,6 +201,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the Datastore definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -195,6 +212,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the Datastore 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. @@ -221,6 +239,7 @@ interface WithCreate */ Datastore create(Context context); } + /** The stage of the Datastore definition allowing to specify tags. */ interface WithTags { /** @@ -231,6 +250,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Datastore definition allowing to specify extendedLocation. */ interface WithExtendedLocation { /** @@ -241,6 +261,7 @@ interface WithExtendedLocation { */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** The stage of the Datastore definition allowing to specify kind. */ interface WithKind { /** @@ -255,6 +276,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the Datastore definition allowing to specify vCenterId. */ interface WithVCenterId { /** @@ -266,6 +288,7 @@ interface WithVCenterId { */ WithCreate withVCenterId(String vCenterId); } + /** The stage of the Datastore definition allowing to specify moRefId. */ interface WithMoRefId { /** @@ -277,6 +300,7 @@ interface WithMoRefId { */ WithCreate withMoRefId(String moRefId); } + /** The stage of the Datastore definition allowing to specify inventoryItemId. */ interface WithInventoryItemId { /** @@ -288,6 +312,7 @@ interface WithInventoryItemId { WithCreate withInventoryItemId(String inventoryItemId); } } + /** * Begins update for the Datastore resource. * @@ -312,6 +337,7 @@ interface Update extends UpdateStages.WithTags { */ Datastore apply(Context context); } + /** The Datastore update stages. */ interface UpdateStages { /** The stage of the Datastore update allowing to specify tags. */ @@ -325,6 +351,7 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DatastoreInventoryItem.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DatastoreInventoryItem.java index a83f7ad0acde..b5e1eb4d6b02 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DatastoreInventoryItem.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DatastoreInventoryItem.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.connectedvmware.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -27,6 +26,10 @@ public final class DatastoreInventoryItem extends InventoryItemProperties { @JsonProperty(value = "freeSpaceGB") private Long freeSpaceGB; + /** Creates an instance of DatastoreInventoryItem class. */ + public DatastoreInventoryItem() { + } + /** * Get the capacityGB property: Gets or sets Maximum capacity of this datastore, in GBs. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Datastores.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Datastores.java index b3c8d84c896c..ea42326a5b88 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Datastores.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Datastores.java @@ -10,20 +10,6 @@ /** Resource collection API of Datastores. */ public interface Datastores { - /** - * Gets a datastore. - * - *

Implements datastore GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param datastoreName Name of the datastore. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the datastore. - */ - Datastore getByResourceGroup(String resourceGroupName, String datastoreName); - /** * Gets a datastore. * @@ -40,18 +26,18 @@ public interface Datastores { Response getByResourceGroupWithResponse(String resourceGroupName, String datastoreName, Context context); /** - * Deletes an datastore. + * Gets a datastore. * - *

Implements datastore DELETE method. + *

Implements datastore GET method. * * @param resourceGroupName The Resource Group Name. * @param datastoreName Name of the datastore. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the datastore. */ - void delete(String resourceGroupName, String datastoreName, Boolean force); + Datastore getByResourceGroup(String resourceGroupName, String datastoreName); /** * Deletes an datastore. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DatastoresList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DatastoresList.java index 4d6a3f7a07ee..603e7a2e245b 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DatastoresList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DatastoresList.java @@ -25,6 +25,10 @@ public final class DatastoresList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of DatastoresList class. */ + public DatastoresList() { + } + /** * Get the nextLink property: Url to follow for getting next page of Datastores. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DiskMode.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DiskMode.java index 34aa65e47797..5fdc0c168131 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DiskMode.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DiskMode.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DiskMode. */ +/** Defines the different types of disk modes. */ public final class DiskMode extends ExpandableStringEnum { /** Static value persistent for DiskMode. */ public static final DiskMode PERSISTENT = fromString("persistent"); @@ -19,6 +19,15 @@ public final class DiskMode extends ExpandableStringEnum { /** Static value independent_nonpersistent for DiskMode. */ public static final DiskMode INDEPENDENT_NONPERSISTENT = fromString("independent_nonpersistent"); + /** + * Creates a new instance of DiskMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskMode() { + } + /** * Creates or finds a DiskMode from its string representation. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DiskType.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DiskType.java index a06ccfed2529..3bc28680ecae 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DiskType.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/DiskType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DiskType. */ +/** Defines the different types of disks. */ public final class DiskType extends ExpandableStringEnum { /** Static value flat for DiskType. */ public static final DiskType FLAT = fromString("flat"); @@ -31,6 +31,15 @@ public final class DiskType extends ExpandableStringEnum { /** Static value unknown for DiskType. */ public static final DiskType UNKNOWN = fromString("unknown"); + /** + * Creates a new instance of DiskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskType() { + } + /** * Creates or finds a DiskType from its string representation. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ErrorDetail.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ErrorDetail.java deleted file mode 100644 index 88d4043ff940..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ErrorDetail.java +++ /dev/null @@ -1,141 +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.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Error details. */ -@Fluent -public final class ErrorDetail { - /* - * The error's code. - */ - @JsonProperty(value = "code", required = true) - private String code; - - /* - * A human readable error message. - */ - @JsonProperty(value = "message", required = true) - private String message; - - /* - * Indicates which property in the request is responsible for the error. - */ - @JsonProperty(value = "target") - private String target; - - /* - * Additional error details. - */ - @JsonProperty(value = "details") - private List details; - - /** - * Get the code property: The error's code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: The error's code. - * - * @param code the code value to set. - * @return the ErrorDetail object itself. - */ - public ErrorDetail withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the message property: A human readable error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: A human readable error message. - * - * @param message the message value to set. - * @return the ErrorDetail object itself. - */ - public ErrorDetail withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the target property: Indicates which property in the request is responsible for the error. - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Set the target property: Indicates which property in the request is responsible for the error. - * - * @param target the target value to set. - * @return the ErrorDetail object itself. - */ - public ErrorDetail withTarget(String target) { - this.target = target; - return this; - } - - /** - * Get the details property: Additional error details. - * - * @return the details value. - */ - public List details() { - return this.details; - } - - /** - * Set the details property: Additional error details. - * - * @param details the details value to set. - * @return the ErrorDetail object itself. - */ - public ErrorDetail withDetails(List details) { - this.details = details; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (code() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property code in model ErrorDetail")); - } - if (message() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property message in model ErrorDetail")); - } - if (details() != null) { - details().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ErrorDetail.class); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ExtendedLocation.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ExtendedLocation.java index 593aadf3123f..394b1df12964 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ExtendedLocation.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ExtendedLocation.java @@ -22,6 +22,10 @@ public final class ExtendedLocation { @JsonProperty(value = "name") private String name; + /** Creates an instance of ExtendedLocation class. */ + public ExtendedLocation() { + } + /** * Get the type property: The extended location type. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/FirmwareType.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/FirmwareType.java index b9fc96061c01..12f4150cb2c4 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/FirmwareType.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/FirmwareType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for FirmwareType. */ +/** Firmware type. */ public final class FirmwareType extends ExpandableStringEnum { /** Static value bios for FirmwareType. */ public static final FirmwareType BIOS = fromString("bios"); @@ -16,6 +16,15 @@ public final class FirmwareType extends ExpandableStringEnum { /** Static value efi for FirmwareType. */ public static final FirmwareType EFI = fromString("efi"); + /** + * Creates a new instance of FirmwareType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirmwareType() { + } + /** * Creates or finds a FirmwareType from its string representation. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgent.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgent.java index 0827615cca34..7ca4e5de0ae9 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgent.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgent.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.connectedvmware.models; import com.azure.core.management.SystemData; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner; import java.util.List; @@ -33,7 +32,7 @@ public interface GuestAgent { String type(); /** - * Gets the systemData property: The system data. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -53,6 +52,14 @@ public interface GuestAgent { */ GuestCredential credentials(); + /** + * Gets the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + String privateLinkScopeResourceId(); + /** * Gets the httpProxyConfig property: HTTP Proxy configuration for the VM. * @@ -89,11 +96,11 @@ public interface GuestAgent { List statuses(); /** - * Gets the provisioningState property: Gets or sets the provisioning state. + * Gets the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - String provisioningState(); + ProvisioningState provisioningState(); /** * Gets the inner com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner object. @@ -101,93 +108,4 @@ public interface GuestAgent { * @return the inner object. */ GuestAgentInner innerModel(); - - /** The entirety of the GuestAgent definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The GuestAgent definition stages. */ - interface DefinitionStages { - /** The first stage of the GuestAgent definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the GuestAgent definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, virtualMachineName. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @return the next definition stage. - */ - WithCreate withExistingVirtualMachine(String resourceGroupName, String virtualMachineName); - } - /** - * The stage of the GuestAgent 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.WithCredentials, - DefinitionStages.WithHttpProxyConfig, - DefinitionStages.WithProvisioningAction { - /** - * Executes the create request. - * - * @return the created resource. - */ - GuestAgent create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - GuestAgent create(Context context); - } - /** The stage of the GuestAgent definition allowing to specify credentials. */ - interface WithCredentials { - /** - * Specifies the credentials property: Username / Password Credentials to provision guest agent.. - * - * @param credentials Username / Password Credentials to provision guest agent. - * @return the next definition stage. - */ - WithCreate withCredentials(GuestCredential credentials); - } - /** The stage of the GuestAgent definition allowing to specify httpProxyConfig. */ - interface WithHttpProxyConfig { - /** - * Specifies the httpProxyConfig property: HTTP Proxy configuration for the VM.. - * - * @param httpProxyConfig HTTP Proxy configuration for the VM. - * @return the next definition stage. - */ - WithCreate withHttpProxyConfig(HttpProxyConfiguration httpProxyConfig); - } - /** The stage of the GuestAgent definition allowing to specify provisioningAction. */ - interface WithProvisioningAction { - /** - * Specifies the provisioningAction property: Gets or sets the guest agent provisioning action.. - * - * @param provisioningAction Gets or sets the guest agent provisioning action. - * @return the next definition stage. - */ - WithCreate withProvisioningAction(ProvisioningAction provisioningAction); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - GuestAgent refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - GuestAgent refresh(Context context); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgentList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgentList.java index 4b4c1fc0f131..25870a12c0e5 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgentList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgentList.java @@ -25,6 +25,10 @@ public final class GuestAgentList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of GuestAgentList class. */ + public GuestAgentList() { + } + /** * Get the nextLink property: Url to follow for getting next page of GuestAgent. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgentProfile.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgentProfile.java deleted file mode 100644 index a32f2b280fec..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgentProfile.java +++ /dev/null @@ -1,100 +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.connectedvmware.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Defines the resource properties. */ -@Immutable -public final class GuestAgentProfile { - /* - * Specifies the VM's unique SMBIOS ID. - */ - @JsonProperty(value = "vmUuid", access = JsonProperty.Access.WRITE_ONLY) - private String vmUuid; - - /* - * The status of the hybrid machine agent. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private StatusTypes status; - - /* - * The time of the last status change. - */ - @JsonProperty(value = "lastStatusChange", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastStatusChange; - - /* - * The hybrid machine agent full version. - */ - @JsonProperty(value = "agentVersion", access = JsonProperty.Access.WRITE_ONLY) - private String agentVersion; - - /* - * Details about the error state. - */ - @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) - private List errorDetails; - - /** - * Get the vmUuid property: Specifies the VM's unique SMBIOS ID. - * - * @return the vmUuid value. - */ - public String vmUuid() { - return this.vmUuid; - } - - /** - * Get the status property: The status of the hybrid machine agent. - * - * @return the status value. - */ - public StatusTypes status() { - return this.status; - } - - /** - * Get the lastStatusChange property: The time of the last status change. - * - * @return the lastStatusChange value. - */ - public OffsetDateTime lastStatusChange() { - return this.lastStatusChange; - } - - /** - * Get the agentVersion property: The hybrid machine agent full version. - * - * @return the agentVersion value. - */ - public String agentVersion() { - return this.agentVersion; - } - - /** - * Get the errorDetails property: Details about the error state. - * - * @return the errorDetails value. - */ - public List errorDetails() { - return this.errorDetails; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errorDetails() != null) { - errorDetails().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestCredential.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestCredential.java index 6507733d970c..d1bdb6109714 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestCredential.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestCredential.java @@ -22,6 +22,10 @@ public final class GuestCredential { @JsonProperty(value = "password") private String password; + /** Creates an instance of GuestCredential class. */ + public GuestCredential() { + } + /** * Get the username property: Gets or sets username to connect with the guest. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HardwareProfile.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HardwareProfile.java index 25f5e982be6f..a83f352bbd79 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HardwareProfile.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HardwareProfile.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** Specifies the hardware settings for the virtual machine. */ @Fluent public final class HardwareProfile { /* @@ -46,6 +46,10 @@ public final class HardwareProfile { @JsonProperty(value = "memoryHotAddEnabled", access = JsonProperty.Access.WRITE_ONLY) private Boolean memoryHotAddEnabled; + /** Creates an instance of HardwareProfile class. */ + public HardwareProfile() { + } + /** * Get the memorySizeMB property: Gets or sets memory size in MBs for the vm. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostInventoryItem.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostInventoryItem.java index afedda519a3f..6d9611e3525f 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostInventoryItem.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostInventoryItem.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.connectedvmware.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -21,6 +20,10 @@ public final class HostInventoryItem extends InventoryItemProperties { @JsonProperty(value = "parent") private InventoryItemDetails parent; + /** Creates an instance of HostInventoryItem class. */ + public HostInventoryItem() { + } + /** * Get the parent property: Parent host inventory resource details. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostModel.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostModel.java index dac50cce1ce6..eaa4913ebacb 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostModel.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostModel.java @@ -121,11 +121,53 @@ public interface HostModel { String customResourceName(); /** - * Gets the provisioningState property: Gets or sets the provisioning state. + * Gets the overallMemoryUsageGB property: Gets the used physical memory on the host in GB. + * + * @return the overallMemoryUsageGB value. + */ + Long overallMemoryUsageGB(); + + /** + * Gets the memorySizeGB property: Gets the total amount of physical memory on the host in GB. + * + * @return the memorySizeGB value. + */ + Long memorySizeGB(); + + /** + * Gets the overallCpuUsageMHz property: Gets the used CPU usage across all cores in MHz. + * + * @return the overallCpuUsageMHz value. + */ + Long overallCpuUsageMHz(); + + /** + * Gets the cpuMhz property: Gets the max CPU usage across all cores in MHz. + * + * @return the cpuMhz value. + */ + Long cpuMhz(); + + /** + * Gets the datastoreIds property: Gets the datastore ARM ids. + * + * @return the datastoreIds value. + */ + List datastoreIds(); + + /** + * Gets the networkIds property: Gets the network ARM ids. + * + * @return the networkIds value. + */ + List networkIds(); + + /** + * Gets the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - String provisioningState(); + ProvisioningState provisioningState(); /** * Gets the region of the resource. @@ -162,11 +204,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The HostModel definition stages. */ interface DefinitionStages { /** The first stage of the HostModel definition. */ interface Blank extends WithLocation { } + /** The stage of the HostModel definition allowing to specify location. */ interface WithLocation { /** @@ -185,6 +229,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the HostModel definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -195,6 +240,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the HostModel 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. @@ -221,6 +267,7 @@ interface WithCreate */ HostModel create(Context context); } + /** The stage of the HostModel definition allowing to specify tags. */ interface WithTags { /** @@ -231,6 +278,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the HostModel definition allowing to specify extendedLocation. */ interface WithExtendedLocation { /** @@ -241,6 +289,7 @@ interface WithExtendedLocation { */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** The stage of the HostModel definition allowing to specify kind. */ interface WithKind { /** @@ -255,6 +304,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the HostModel definition allowing to specify vCenterId. */ interface WithVCenterId { /** @@ -266,6 +316,7 @@ interface WithVCenterId { */ WithCreate withVCenterId(String vCenterId); } + /** The stage of the HostModel definition allowing to specify moRefId. */ interface WithMoRefId { /** @@ -277,6 +328,7 @@ interface WithMoRefId { */ WithCreate withMoRefId(String moRefId); } + /** The stage of the HostModel definition allowing to specify inventoryItemId. */ interface WithInventoryItemId { /** @@ -288,6 +340,7 @@ interface WithInventoryItemId { WithCreate withInventoryItemId(String inventoryItemId); } } + /** * Begins update for the HostModel resource. * @@ -312,6 +365,7 @@ interface Update extends UpdateStages.WithTags { */ HostModel apply(Context context); } + /** The HostModel update stages. */ interface UpdateStages { /** The stage of the HostModel update allowing to specify tags. */ @@ -325,6 +379,7 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Hosts.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Hosts.java index 840d513d330d..dc7933c025dc 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Hosts.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Hosts.java @@ -10,20 +10,6 @@ /** Resource collection API of Hosts. */ public interface Hosts { - /** - * Gets a host. - * - *

Implements host GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param hostname Name of the host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the host. - */ - HostModel getByResourceGroup(String resourceGroupName, String hostname); - /** * Gets a host. * @@ -40,18 +26,18 @@ public interface Hosts { Response getByResourceGroupWithResponse(String resourceGroupName, String hostname, Context context); /** - * Deletes an host. + * Gets a host. * - *

Implements host DELETE method. + *

Implements host GET method. * * @param resourceGroupName The Resource Group Name. * @param hostname Name of the host. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the host. */ - void delete(String resourceGroupName, String hostname, Boolean force); + HostModel getByResourceGroup(String resourceGroupName, String hostname); /** * Deletes an host. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostsList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostsList.java index 52d8318b133f..096c33a207fa 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostsList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HostsList.java @@ -25,6 +25,10 @@ public final class HostsList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of HostsList class. */ + public HostsList() { + } + /** * Get the nextLink property: Url to follow for getting next page of Hosts. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HttpProxyConfiguration.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HttpProxyConfiguration.java index e164ffecece0..05b04814b044 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HttpProxyConfiguration.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HttpProxyConfiguration.java @@ -16,6 +16,10 @@ public final class HttpProxyConfiguration { @JsonProperty(value = "httpsProxy") private String httpsProxy; + /** Creates an instance of HttpProxyConfiguration class. */ + public HttpProxyConfiguration() { + } + /** * Get the httpsProxy property: Gets or sets httpsProxy url. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HybridIdentityMetadata.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HybridIdentityMetadata.java deleted file mode 100644 index 81becfe935f1..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HybridIdentityMetadata.java +++ /dev/null @@ -1,151 +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.connectedvmware.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.fluent.models.HybridIdentityMetadataInner; - -/** An immutable client-side representation of HybridIdentityMetadata. */ -public interface HybridIdentityMetadata { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: The system data. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the vmId property: Gets or sets the Vm Id. - * - * @return the vmId value. - */ - String vmId(); - - /** - * Gets the publicKey property: Gets or sets the Public Key. - * - * @return the publicKey value. - */ - String publicKey(); - - /** - * Gets the identity property: The identity of the resource. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.connectedvmware.fluent.models.HybridIdentityMetadataInner object. - * - * @return the inner object. - */ - HybridIdentityMetadataInner innerModel(); - - /** The entirety of the HybridIdentityMetadata definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The HybridIdentityMetadata definition stages. */ - interface DefinitionStages { - /** The first stage of the HybridIdentityMetadata definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the HybridIdentityMetadata definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, virtualMachineName. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @return the next definition stage. - */ - WithCreate withExistingVirtualMachine(String resourceGroupName, String virtualMachineName); - } - /** - * The stage of the HybridIdentityMetadata 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.WithVmId, DefinitionStages.WithPublicKey { - /** - * Executes the create request. - * - * @return the created resource. - */ - HybridIdentityMetadata create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - HybridIdentityMetadata create(Context context); - } - /** The stage of the HybridIdentityMetadata definition allowing to specify vmId. */ - interface WithVmId { - /** - * Specifies the vmId property: Gets or sets the Vm Id.. - * - * @param vmId Gets or sets the Vm Id. - * @return the next definition stage. - */ - WithCreate withVmId(String vmId); - } - /** The stage of the HybridIdentityMetadata definition allowing to specify publicKey. */ - interface WithPublicKey { - /** - * Specifies the publicKey property: Gets or sets the Public Key.. - * - * @param publicKey Gets or sets the Public Key. - * @return the next definition stage. - */ - WithCreate withPublicKey(String publicKey); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - HybridIdentityMetadata refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - HybridIdentityMetadata refresh(Context context); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HybridIdentityMetadatas.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HybridIdentityMetadatas.java deleted file mode 100644 index dc7605f2fe61..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/HybridIdentityMetadatas.java +++ /dev/null @@ -1,166 +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.connectedvmware.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 HybridIdentityMetadatas. */ -public interface HybridIdentityMetadatas { - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the HybridIdentityMetadata. - */ - HybridIdentityMetadata get(String resourceGroupName, String virtualMachineName, String metadataName); - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @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 defines the HybridIdentityMetadata along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String virtualMachineName, String metadataName, Context context); - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String virtualMachineName, String metadataName); - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param metadataName Name of the HybridIdentityMetadata. - * @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 virtualMachineName, String metadataName, Context context); - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. - */ - PagedIterable listByVm(String resourceGroupName, String virtualMachineName); - - /** - * Implements GET HybridIdentityMetadata in a vm. - * - *

Returns the list of HybridIdentityMetadata of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. - */ - PagedIterable listByVm( - String resourceGroupName, String virtualMachineName, Context context); - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @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 defines the HybridIdentityMetadata along with {@link Response}. - */ - HybridIdentityMetadata getById(String id); - - /** - * Gets HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata GET method. - * - * @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 defines the HybridIdentityMetadata along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes an HybridIdentityMetadata. - * - *

Implements HybridIdentityMetadata DELETE method. - * - * @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 HybridIdentityMetadata resource. - * - * @param name resource name. - * @return the first stage of the new HybridIdentityMetadata definition. - */ - HybridIdentityMetadata.DefinitionStages.Blank define(String name); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Identity.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Identity.java deleted file mode 100644 index ffb75b624c47..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/Identity.java +++ /dev/null @@ -1,83 +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.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Managed service identity. */ -@Fluent -public class Identity { - /* - * The principal id of managed service identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant of managed service identity. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The type of managed service identity. - */ - @JsonProperty(value = "type", required = true) - private IdentityType type; - - /** - * Get the principalId property: The principal id of managed service identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant of managed service identity. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The type of managed service identity. - * - * @return the type value. - */ - public IdentityType type() { - return this.type; - } - - /** - * Set the type property: The type of managed service identity. - * - * @param type the type value to set. - * @return the Identity object itself. - */ - public Identity withType(IdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Identity")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Identity.class); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/IdentityType.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/IdentityType.java deleted file mode 100644 index e21c713f8c97..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/IdentityType.java +++ /dev/null @@ -1,38 +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.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IdentityType. */ -public final class IdentityType extends ExpandableStringEnum { - /** Static value None for IdentityType. */ - public static final IdentityType NONE = fromString("None"); - - /** Static value SystemAssigned for IdentityType. */ - public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - - /** - * Creates or finds a IdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding IdentityType. - */ - @JsonCreator - public static IdentityType fromString(String name) { - return fromString(name, IdentityType.class); - } - - /** - * Gets known IdentityType values. - * - * @return known IdentityType values. - */ - public static Collection values() { - return values(IdentityType.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InfrastructureProfile.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InfrastructureProfile.java new file mode 100644 index 000000000000..6567f895bca5 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InfrastructureProfile.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.connectedvmware.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the vCenter infrastructure specific settings for the virtual machine. */ +@Fluent +public final class InfrastructureProfile { + /* + * Gets or sets the ARM Id of the template resource to deploy the virtual machine. + */ + @JsonProperty(value = "templateId") + private String templateId; + + /* + * Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. + */ + @JsonProperty(value = "vCenterId") + private String vCenterId; + + /* + * Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. + */ + @JsonProperty(value = "moRefId", access = JsonProperty.Access.WRITE_ONLY) + private String moRefId; + + /* + * Gets or sets the inventory Item ID for the virtual machine. + */ + @JsonProperty(value = "inventoryItemId") + private String inventoryItemId; + + /* + * Gets or sets the vCenter Managed Object name for the virtual machine. + */ + @JsonProperty(value = "moName", access = JsonProperty.Access.WRITE_ONLY) + private String moName; + + /* + * Gets or sets the folder path of the vm. + */ + @JsonProperty(value = "folderPath", access = JsonProperty.Access.WRITE_ONLY) + private String folderPath; + + /* + * Gets or sets the instance uuid of the vm. + */ + @JsonProperty(value = "instanceUuid", access = JsonProperty.Access.WRITE_ONLY) + private String instanceUuid; + + /* + * Gets or sets the SMBIOS UUID of the vm. + */ + @JsonProperty(value = "smbiosUuid") + private String smbiosUuid; + + /* + * Firmware type + */ + @JsonProperty(value = "firmwareType") + private FirmwareType firmwareType; + + /* + * Gets the name of the corresponding resource in Kubernetes. + */ + @JsonProperty(value = "customResourceName", access = JsonProperty.Access.WRITE_ONLY) + private String customResourceName; + + /** Creates an instance of InfrastructureProfile class. */ + public InfrastructureProfile() { + } + + /** + * Get the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual machine. + * + * @return the templateId value. + */ + public String templateId() { + return this.templateId; + } + + /** + * Set the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual machine. + * + * @param templateId the templateId value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withTemplateId(String templateId) { + this.templateId = templateId; + return this; + } + + /** + * Get the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. + * + * @return the vCenterId value. + */ + public String vCenterId() { + return this.vCenterId; + } + + /** + * Set the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. + * + * @param vCenterId the vCenterId value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withVCenterId(String vCenterId) { + this.vCenterId = vCenterId; + return this; + } + + /** + * Get the moRefId property: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. + * + * @return the moRefId value. + */ + public String moRefId() { + return this.moRefId; + } + + /** + * Get the inventoryItemId property: Gets or sets the inventory Item ID for the virtual machine. + * + * @return the inventoryItemId value. + */ + public String inventoryItemId() { + return this.inventoryItemId; + } + + /** + * Set the inventoryItemId property: Gets or sets the inventory Item ID for the virtual machine. + * + * @param inventoryItemId the inventoryItemId value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withInventoryItemId(String inventoryItemId) { + this.inventoryItemId = inventoryItemId; + return this; + } + + /** + * Get the moName property: Gets or sets the vCenter Managed Object name for the virtual machine. + * + * @return the moName value. + */ + public String moName() { + return this.moName; + } + + /** + * Get the folderPath property: Gets or sets the folder path of the vm. + * + * @return the folderPath value. + */ + public String folderPath() { + return this.folderPath; + } + + /** + * Get the instanceUuid property: Gets or sets the instance uuid of the vm. + * + * @return the instanceUuid value. + */ + public String instanceUuid() { + return this.instanceUuid; + } + + /** + * Get the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm. + * + * @return the smbiosUuid value. + */ + public String smbiosUuid() { + return this.smbiosUuid; + } + + /** + * Set the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm. + * + * @param smbiosUuid the smbiosUuid value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withSmbiosUuid(String smbiosUuid) { + this.smbiosUuid = smbiosUuid; + return this; + } + + /** + * Get the firmwareType property: Firmware type. + * + * @return the firmwareType value. + */ + public FirmwareType firmwareType() { + return this.firmwareType; + } + + /** + * Set the firmwareType property: Firmware type. + * + * @param firmwareType the firmwareType value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withFirmwareType(FirmwareType firmwareType) { + this.firmwareType = firmwareType; + return this; + } + + /** + * Get the customResourceName property: Gets the name of the corresponding resource in Kubernetes. + * + * @return the customResourceName value. + */ + public String customResourceName() { + return this.customResourceName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItem.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItem.java index b86d4850475e..d3ace1217771 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItem.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItem.java @@ -32,11 +32,11 @@ public interface InventoryItem { String type(); /** - * Gets the systemData property: The system data. + * Gets the properties property: Resource properties. * - * @return the systemData value. + * @return the properties value. */ - SystemData systemData(); + InventoryItemProperties properties(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of @@ -48,33 +48,11 @@ public interface InventoryItem { String kind(); /** - * Gets the managedResourceId property: Gets or sets the tracked resource id corresponding to the inventory - * resource. - * - * @return the managedResourceId value. - */ - String managedResourceId(); - - /** - * Gets the moRefId property: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the moRefId value. - */ - String moRefId(); - - /** - * Gets the moName property: Gets or sets the vCenter Managed Object name for the inventory item. - * - * @return the moName value. - */ - String moName(); - - /** - * Gets the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. + * @return the systemData value. */ - String provisioningState(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemInner object. @@ -85,13 +63,18 @@ public interface InventoryItem { /** The entirety of the InventoryItem definition. */ interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { } + /** The InventoryItem definition stages. */ interface DefinitionStages { /** The first stage of the InventoryItem definition. */ interface Blank extends WithParentResource { } + /** The stage of the InventoryItem definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -101,17 +84,25 @@ interface WithParentResource { * @param vcenterName Name of the vCenter. * @return the next definition stage. */ - WithCreate withExistingVcenter(String resourceGroupName, String vcenterName); + WithProperties withExistingVcenter(String resourceGroupName, String vcenterName); + } + + /** The stage of the InventoryItem definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Resource properties.. + * + * @param properties Resource properties. + * @return the next definition stage. + */ + WithCreate withProperties(InventoryItemProperties properties); } + /** * The stage of the InventoryItem 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.WithKind, - DefinitionStages.WithManagedResourceId, - DefinitionStages.WithMoRefId, - DefinitionStages.WithMoName { + interface WithCreate extends DefinitionStages.WithKind { /** * Executes the create request. * @@ -127,6 +118,7 @@ interface WithCreate */ InventoryItem create(Context context); } + /** The stage of the InventoryItem definition allowing to specify kind. */ interface WithKind { /** @@ -141,39 +133,8 @@ interface WithKind { */ WithCreate withKind(String kind); } - /** The stage of the InventoryItem definition allowing to specify managedResourceId. */ - interface WithManagedResourceId { - /** - * Specifies the managedResourceId property: Gets or sets the tracked resource id corresponding to the - * inventory resource.. - * - * @param managedResourceId Gets or sets the tracked resource id corresponding to the inventory resource. - * @return the next definition stage. - */ - WithCreate withManagedResourceId(String managedResourceId); - } - /** The stage of the InventoryItem definition allowing to specify moRefId. */ - interface WithMoRefId { - /** - * Specifies the moRefId property: Gets or sets the MoRef (Managed Object Reference) ID for the inventory - * item.. - * - * @param moRefId Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. - * @return the next definition stage. - */ - WithCreate withMoRefId(String moRefId); - } - /** The stage of the InventoryItem definition allowing to specify moName. */ - interface WithMoName { - /** - * Specifies the moName property: Gets or sets the vCenter Managed Object name for the inventory item.. - * - * @param moName Gets or sets the vCenter Managed Object name for the inventory item. - * @return the next definition stage. - */ - WithCreate withMoName(String moName); - } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemDetails.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemDetails.java index 3fa454100936..7a8ccbce37bb 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemDetails.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemDetails.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** Describes the properties of an Inventory Item reference. */ @Fluent public final class InventoryItemDetails { /* @@ -22,6 +22,16 @@ public final class InventoryItemDetails { @JsonProperty(value = "moName") private String moName; + /* + * The inventory type. + */ + @JsonProperty(value = "inventoryType") + private InventoryType inventoryType; + + /** Creates an instance of InventoryItemDetails class. */ + public InventoryItemDetails() { + } + /** * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. * @@ -62,6 +72,26 @@ public InventoryItemDetails withMoName(String moName) { return this; } + /** + * Get the inventoryType property: The inventory type. + * + * @return the inventoryType value. + */ + public InventoryType inventoryType() { + return this.inventoryType; + } + + /** + * Set the inventoryType property: The inventory type. + * + * @param inventoryType the inventoryType value to set. + * @return the InventoryItemDetails object itself. + */ + public InventoryItemDetails withInventoryType(InventoryType inventoryType) { + this.inventoryType = inventoryType; + return this; + } + /** * Validates the instance. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/InventoryItemProperties.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemProperties.java similarity index 82% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/InventoryItemProperties.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemProperties.java index 77f5ade5de14..92d7b09c1776 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/fluent/models/InventoryItemProperties.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemProperties.java @@ -2,22 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.connectedvmware.fluent.models; +package com.azure.resourcemanager.connectedvmware.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.models.ClusterInventoryItem; -import com.azure.resourcemanager.connectedvmware.models.DatastoreInventoryItem; -import com.azure.resourcemanager.connectedvmware.models.HostInventoryItem; -import com.azure.resourcemanager.connectedvmware.models.ResourcePoolInventoryItem; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInventoryItem; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineTemplateInventoryItem; -import com.azure.resourcemanager.connectedvmware.models.VirtualNetworkInventoryItem; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Defines the resource properties. */ +/** Describes the properties of an Inventory Item. */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -54,10 +47,14 @@ public class InventoryItemProperties { private String moName; /* - * Gets or sets the provisioning state. + * Gets the provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** Creates an instance of InventoryItemProperties class. */ + public InventoryItemProperties() { + } /** * Get the managedResourceId property: Gets or sets the tracked resource id corresponding to the inventory resource. @@ -120,11 +117,11 @@ public InventoryItemProperties withMoName(String moName) { } /** - * Get the provisioningState property: Gets or sets the provisioning state. + * Get the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItems.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItems.java index 81dbd47ff33a..afb3938784ef 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItems.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItems.java @@ -18,12 +18,14 @@ public interface InventoryItems { * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. + * @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 defines the inventory item. + * @return defines the inventory item along with {@link Response}. */ - InventoryItem get(String resourceGroupName, String vcenterName, String inventoryItemName); + Response getWithResponse( + String resourceGroupName, String vcenterName, String inventoryItemName, Context context); /** * Gets InventoryItem. @@ -33,14 +35,12 @@ public interface InventoryItems { * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. - * @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 defines the inventory item along with {@link Response}. + * @return defines the inventory item. */ - Response getWithResponse( - String resourceGroupName, String vcenterName, String inventoryItemName, Context context); + InventoryItem get(String resourceGroupName, String vcenterName, String inventoryItemName); /** * Deletes an inventoryItem. @@ -50,11 +50,14 @@ Response getWithResponse( * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String vcenterName, String inventoryItemName); + Response deleteWithResponse( + String resourceGroupName, String vcenterName, String inventoryItemName, Context context); /** * Deletes an inventoryItem. @@ -64,14 +67,11 @@ Response getWithResponse( * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. * @param inventoryItemName Name of the inventoryItem. - * @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 vcenterName, String inventoryItemName, Context context); + void delete(String resourceGroupName, String vcenterName, String inventoryItemName); /** * Implements GET inventoryItems in a vCenter. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemsList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemsList.java index 6f1479214382..22fc5ad75faa 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemsList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryItemsList.java @@ -25,6 +25,10 @@ public final class InventoryItemsList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of InventoryItemsList class. */ + public InventoryItemsList() { + } + /** * Get the nextLink property: Url to follow for getting next page of InventoryItems. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryType.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryType.java index ddb9224c2eef..0eae520886c1 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryType.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/InventoryType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for InventoryType. */ +/** The inventory type. */ public final class InventoryType extends ExpandableStringEnum { /** Static value ResourcePool for InventoryType. */ public static final InventoryType RESOURCE_POOL = fromString("ResourcePool"); @@ -31,6 +31,15 @@ public final class InventoryType extends ExpandableStringEnum { /** Static value Host for InventoryType. */ public static final InventoryType HOST = fromString("Host"); + /** + * Creates a new instance of InventoryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InventoryType() { + } + /** * Creates or finds a InventoryType from its string representation. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/IpAddressAllocationMethod.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/IpAddressAllocationMethod.java index c416039cf236..96abc24d3180 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/IpAddressAllocationMethod.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/IpAddressAllocationMethod.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for IpAddressAllocationMethod. */ +/** IP address allocation method. */ public final class IpAddressAllocationMethod extends ExpandableStringEnum { /** Static value unset for IpAddressAllocationMethod. */ public static final IpAddressAllocationMethod UNSET = fromString("unset"); @@ -28,6 +28,15 @@ public final class IpAddressAllocationMethod extends ExpandableStringEnum classificationsToInclude; - - /* - * packages to include in the patch operation. Format: packageName_packageVersion - */ - @JsonProperty(value = "packageNameMasksToInclude") - private List packageNameMasksToInclude; - - /* - * packages to exclude in the patch operation. Format: packageName_packageVersion - */ - @JsonProperty(value = "packageNameMasksToExclude") - private List packageNameMasksToExclude; - - /** - * Get the classificationsToInclude property: The update classifications to select when installing patches for - * Linux. - * - * @return the classificationsToInclude value. - */ - public List classificationsToInclude() { - return this.classificationsToInclude; - } - - /** - * Set the classificationsToInclude property: The update classifications to select when installing patches for - * Linux. - * - * @param classificationsToInclude the classificationsToInclude value to set. - * @return the LinuxParameters object itself. - */ - public LinuxParameters withClassificationsToInclude( - List classificationsToInclude) { - this.classificationsToInclude = classificationsToInclude; - return this; - } - - /** - * Get the packageNameMasksToInclude property: packages to include in the patch operation. Format: - * packageName_packageVersion. - * - * @return the packageNameMasksToInclude value. - */ - public List packageNameMasksToInclude() { - return this.packageNameMasksToInclude; - } - - /** - * Set the packageNameMasksToInclude property: packages to include in the patch operation. Format: - * packageName_packageVersion. - * - * @param packageNameMasksToInclude the packageNameMasksToInclude value to set. - * @return the LinuxParameters object itself. - */ - public LinuxParameters withPackageNameMasksToInclude(List packageNameMasksToInclude) { - this.packageNameMasksToInclude = packageNameMasksToInclude; - return this; - } - - /** - * Get the packageNameMasksToExclude property: packages to exclude in the patch operation. Format: - * packageName_packageVersion. - * - * @return the packageNameMasksToExclude value. - */ - public List packageNameMasksToExclude() { - return this.packageNameMasksToExclude; - } - - /** - * Set the packageNameMasksToExclude property: packages to exclude in the patch operation. Format: - * packageName_packageVersion. - * - * @param packageNameMasksToExclude the packageNameMasksToExclude value to set. - * @return the LinuxParameters object itself. - */ - public LinuxParameters withPackageNameMasksToExclude(List packageNameMasksToExclude) { - this.packageNameMasksToExclude = packageNameMasksToExclude; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtension.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtension.java deleted file mode 100644 index 81dc1d93a60a..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtension.java +++ /dev/null @@ -1,493 +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.connectedvmware.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.fluent.models.MachineExtensionInner; -import java.util.Map; - -/** An immutable client-side representation of MachineExtension. */ -public interface MachineExtension { - /** - * 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: The system data. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - String forceUpdateTag(); - - /** - * Gets the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - String publisher(); - - /** - * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the typePropertiesType value. - */ - String typePropertiesType(); - - /** - * Gets the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - String typeHandlerVersion(); - - /** - * Gets the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * - * @return the enableAutomaticUpgrade value. - */ - Boolean enableAutomaticUpgrade(); - - /** - * Gets the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if - * one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - Boolean autoUpgradeMinorVersion(); - - /** - * Gets the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - Object settings(); - - /** - * Gets the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - Object protectedSettings(); - - /** - * Gets the provisioningState property: The provisioning state, which only appears in the response. - * - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * Gets the instanceView property: The machine extension instance view. - * - * @return the instanceView value. - */ - MachineExtensionPropertiesInstanceView instanceView(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.connectedvmware.fluent.models.MachineExtensionInner object. - * - * @return the inner object. - */ - MachineExtensionInner innerModel(); - - /** The entirety of the MachineExtension definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithCreate { - } - /** The MachineExtension definition stages. */ - interface DefinitionStages { - /** The first stage of the MachineExtension definition. */ - interface Blank extends WithLocation { - } - /** The stage of the MachineExtension 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. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); - } - /** The stage of the MachineExtension definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, name. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be created or updated. - * @return the next definition stage. - */ - WithCreate withExistingVirtualMachine(String resourceGroupName, String name); - } - /** - * The stage of the MachineExtension definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithForceUpdateTag, - DefinitionStages.WithPublisher, - DefinitionStages.WithTypePropertiesType, - DefinitionStages.WithTypeHandlerVersion, - DefinitionStages.WithEnableAutomaticUpgrade, - DefinitionStages.WithAutoUpgradeMinorVersion, - DefinitionStages.WithSettings, - DefinitionStages.WithProtectedSettings, - DefinitionStages.WithInstanceView { - /** - * Executes the create request. - * - * @return the created resource. - */ - MachineExtension create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - MachineExtension create(Context context); - } - /** The stage of the MachineExtension 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 MachineExtension definition allowing to specify forceUpdateTag. */ - interface WithForceUpdateTag { - /** - * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the - * extension configuration has not changed.. - * - * @param forceUpdateTag How the extension handler should be forced to update even if the extension - * configuration has not changed. - * @return the next definition stage. - */ - WithCreate withForceUpdateTag(String forceUpdateTag); - } - /** The stage of the MachineExtension definition allowing to specify publisher. */ - interface WithPublisher { - /** - * Specifies the publisher property: The name of the extension handler publisher.. - * - * @param publisher The name of the extension handler publisher. - * @return the next definition stage. - */ - WithCreate withPublisher(String publisher); - } - /** The stage of the MachineExtension definition allowing to specify typePropertiesType. */ - interface WithTypePropertiesType { - /** - * Specifies the typePropertiesType property: Specifies the type of the extension; an example is - * "CustomScriptExtension".. - * - * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". - * @return the next definition stage. - */ - WithCreate withTypePropertiesType(String typePropertiesType); - } - /** The stage of the MachineExtension definition allowing to specify typeHandlerVersion. */ - interface WithTypeHandlerVersion { - /** - * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. - * - * @param typeHandlerVersion Specifies the version of the script handler. - * @return the next definition stage. - */ - WithCreate withTypeHandlerVersion(String typeHandlerVersion); - } - /** The stage of the MachineExtension definition allowing to specify enableAutomaticUpgrade. */ - interface WithEnableAutomaticUpgrade { - /** - * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically - * upgraded by the platform if there is a newer version available.. - * - * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * @return the next definition stage. - */ - WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); - } - /** The stage of the MachineExtension definition allowing to specify autoUpgradeMinorVersion. */ - interface WithAutoUpgradeMinorVersion { - /** - * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor - * version if one is available at deployment time. Once deployed, however, the extension will not upgrade - * minor versions unless redeployed, even with this property set to true.. - * - * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is - * available at deployment time. Once deployed, however, the extension will not upgrade minor versions - * unless redeployed, even with this property set to true. - * @return the next definition stage. - */ - WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); - } - /** The stage of the MachineExtension definition allowing to specify settings. */ - interface WithSettings { - /** - * Specifies the settings property: Json formatted public settings for the extension.. - * - * @param settings Json formatted public settings for the extension. - * @return the next definition stage. - */ - WithCreate withSettings(Object settings); - } - /** The stage of the MachineExtension definition allowing to specify protectedSettings. */ - interface WithProtectedSettings { - /** - * Specifies the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all.. - * - * @param protectedSettings The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * @return the next definition stage. - */ - WithCreate withProtectedSettings(Object protectedSettings); - } - /** The stage of the MachineExtension definition allowing to specify instanceView. */ - interface WithInstanceView { - /** - * Specifies the instanceView property: The machine extension instance view.. - * - * @param instanceView The machine extension instance view. - * @return the next definition stage. - */ - WithCreate withInstanceView(MachineExtensionPropertiesInstanceView instanceView); - } - } - /** - * Begins update for the MachineExtension resource. - * - * @return the stage of resource update. - */ - MachineExtension.Update update(); - - /** The template for MachineExtension update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithForceUpdateTag, - UpdateStages.WithPublisher, - UpdateStages.WithType, - UpdateStages.WithTypeHandlerVersion, - UpdateStages.WithEnableAutomaticUpgrade, - UpdateStages.WithAutoUpgradeMinorVersion, - UpdateStages.WithSettings, - UpdateStages.WithProtectedSettings { - /** - * Executes the update request. - * - * @return the updated resource. - */ - MachineExtension apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - MachineExtension apply(Context context); - } - /** The MachineExtension update stages. */ - interface UpdateStages { - /** The stage of the MachineExtension 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 MachineExtension update allowing to specify forceUpdateTag. */ - interface WithForceUpdateTag { - /** - * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the - * extension configuration has not changed.. - * - * @param forceUpdateTag How the extension handler should be forced to update even if the extension - * configuration has not changed. - * @return the next definition stage. - */ - Update withForceUpdateTag(String forceUpdateTag); - } - /** The stage of the MachineExtension update allowing to specify publisher. */ - interface WithPublisher { - /** - * Specifies the publisher property: The name of the extension handler publisher.. - * - * @param publisher The name of the extension handler publisher. - * @return the next definition stage. - */ - Update withPublisher(String publisher); - } - /** The stage of the MachineExtension update allowing to specify type. */ - interface WithType { - /** - * Specifies the type property: Specifies the type of the extension; an example is "CustomScriptExtension".. - * - * @param type Specifies the type of the extension; an example is "CustomScriptExtension". - * @return the next definition stage. - */ - Update withType(String type); - } - /** The stage of the MachineExtension update allowing to specify typeHandlerVersion. */ - interface WithTypeHandlerVersion { - /** - * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. - * - * @param typeHandlerVersion Specifies the version of the script handler. - * @return the next definition stage. - */ - Update withTypeHandlerVersion(String typeHandlerVersion); - } - /** The stage of the MachineExtension update allowing to specify enableAutomaticUpgrade. */ - interface WithEnableAutomaticUpgrade { - /** - * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically - * upgraded by the platform if there is a newer version available.. - * - * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * @return the next definition stage. - */ - Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); - } - /** The stage of the MachineExtension update allowing to specify autoUpgradeMinorVersion. */ - interface WithAutoUpgradeMinorVersion { - /** - * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor - * version if one is available at deployment time. Once deployed, however, the extension will not upgrade - * minor versions unless redeployed, even with this property set to true.. - * - * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is - * available at deployment time. Once deployed, however, the extension will not upgrade minor versions - * unless redeployed, even with this property set to true. - * @return the next definition stage. - */ - Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); - } - /** The stage of the MachineExtension update allowing to specify settings. */ - interface WithSettings { - /** - * Specifies the settings property: Json formatted public settings for the extension.. - * - * @param settings Json formatted public settings for the extension. - * @return the next definition stage. - */ - Update withSettings(Object settings); - } - /** The stage of the MachineExtension update allowing to specify protectedSettings. */ - interface WithProtectedSettings { - /** - * Specifies the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all.. - * - * @param protectedSettings The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * @return the next definition stage. - */ - Update withProtectedSettings(Object protectedSettings); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - MachineExtension refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - MachineExtension refresh(Context context); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionInstanceView.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionInstanceView.java deleted file mode 100644 index c98b267bbb5a..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionInstanceView.java +++ /dev/null @@ -1,94 +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.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the Machine Extension Instance View. */ -@Fluent -public class MachineExtensionInstanceView { - /* - * The machine extension name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Specifies the type of the extension; an example is "CustomScriptExtension". - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Specifies the version of the script handler. - */ - @JsonProperty(value = "typeHandlerVersion", access = JsonProperty.Access.WRITE_ONLY) - private String typeHandlerVersion; - - /* - * Instance view status. - */ - @JsonProperty(value = "status") - private MachineExtensionInstanceViewStatus status; - - /** - * Get the name property: The machine extension name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.typeHandlerVersion; - } - - /** - * Get the status property: Instance view status. - * - * @return the status value. - */ - public MachineExtensionInstanceViewStatus status() { - return this.status; - } - - /** - * Set the status property: Instance view status. - * - * @param status the status value to set. - * @return the MachineExtensionInstanceView object itself. - */ - public MachineExtensionInstanceView withStatus(MachineExtensionInstanceViewStatus status) { - this.status = status; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionInstanceViewStatus.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionInstanceViewStatus.java deleted file mode 100644 index 28d3ed2fe005..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionInstanceViewStatus.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Instance view status. */ -@Immutable -public final class MachineExtensionInstanceViewStatus { - /* - * The status code. - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private String code; - - /* - * The level code. - */ - @JsonProperty(value = "level", access = JsonProperty.Access.WRITE_ONLY) - private StatusLevelTypes level; - - /* - * The short localizable label for the status. - */ - @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) - private String displayStatus; - - /* - * The detailed status message, including for alerts and error messages. - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /* - * The time of the status. - */ - @JsonProperty(value = "time", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime time; - - /** - * Get the code property: The status code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the level property: The level code. - * - * @return the level value. - */ - public StatusLevelTypes level() { - return this.level; - } - - /** - * Get the displayStatus property: The short localizable label for the status. - * - * @return the displayStatus value. - */ - public String displayStatus() { - return this.displayStatus; - } - - /** - * Get the message property: The detailed status message, including for alerts and error messages. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the time property: The time of the status. - * - * @return the time value. - */ - public OffsetDateTime time() { - return this.time; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionPropertiesInstanceView.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionPropertiesInstanceView.java deleted file mode 100644 index aab7f80ab32f..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionPropertiesInstanceView.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.annotation.Fluent; - -/** The machine extension instance view. */ -@Fluent -public final class MachineExtensionPropertiesInstanceView extends MachineExtensionInstanceView { - /** {@inheritDoc} */ - @Override - public MachineExtensionPropertiesInstanceView withStatus(MachineExtensionInstanceViewStatus status) { - super.withStatus(status); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionUpdate.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionUpdate.java deleted file mode 100644 index 3e31e1ff995a..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionUpdate.java +++ /dev/null @@ -1,243 +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.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.MachineExtensionUpdateProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes a Machine Extension Update. */ -@Fluent -public final class MachineExtensionUpdate extends ResourcePatch { - /* - * Describes Machine Extension Update Properties. - */ - @JsonProperty(value = "properties") - private MachineExtensionUpdateProperties innerProperties; - - /** - * Get the innerProperties property: Describes Machine Extension Update Properties. - * - * @return the innerProperties value. - */ - private MachineExtensionUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public MachineExtensionUpdate withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @return the forceUpdateTag value. - */ - public String forceUpdateTag() { - return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); - } - - /** - * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension - * configuration has not changed. - * - * @param forceUpdateTag the forceUpdateTag value to set. - * @return the MachineExtensionUpdate object itself. - */ - public MachineExtensionUpdate withForceUpdateTag(String forceUpdateTag) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionUpdateProperties(); - } - this.innerProperties().withForceUpdateTag(forceUpdateTag); - return this; - } - - /** - * Get the publisher property: The name of the extension handler publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The name of the extension handler publisher. - * - * @param publisher the publisher value to set. - * @return the MachineExtensionUpdate object itself. - */ - public MachineExtensionUpdate withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionUpdateProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @return the type value. - */ - public String type() { - return this.innerProperties() == null ? null : this.innerProperties().type(); - } - - /** - * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". - * - * @param type the type value to set. - * @return the MachineExtensionUpdate object itself. - */ - public MachineExtensionUpdate withType(String type) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionUpdateProperties(); - } - this.innerProperties().withType(type); - return this; - } - - /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. - * - * @return the typeHandlerVersion value. - */ - public String typeHandlerVersion() { - return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); - } - - /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. - * - * @param typeHandlerVersion the typeHandlerVersion value to set. - * @return the MachineExtensionUpdate object itself. - */ - public MachineExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionUpdateProperties(); - } - this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); - return this; - } - - /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * - * @return the enableAutomaticUpgrade value. - */ - public Boolean enableAutomaticUpgrade() { - return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); - } - - /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the - * platform if there is a newer version available. - * - * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. - * @return the MachineExtensionUpdate object itself. - */ - public MachineExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionUpdateProperties(); - } - this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); - return this; - } - - /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @return the autoUpgradeMinorVersion value. - */ - public Boolean autoUpgradeMinorVersion() { - return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); - } - - /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless - * redeployed, even with this property set to true. - * - * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. - * @return the MachineExtensionUpdate object itself. - */ - public MachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionUpdateProperties(); - } - this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); - return this; - } - - /** - * Get the settings property: Json formatted public settings for the extension. - * - * @return the settings value. - */ - public Object settings() { - return this.innerProperties() == null ? null : this.innerProperties().settings(); - } - - /** - * Set the settings property: Json formatted public settings for the extension. - * - * @param settings the settings value to set. - * @return the MachineExtensionUpdate object itself. - */ - public MachineExtensionUpdate withSettings(Object settings) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionUpdateProperties(); - } - this.innerProperties().withSettings(settings); - return this; - } - - /** - * Get the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @return the protectedSettings value. - */ - public Object protectedSettings() { - return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); - } - - /** - * Set the protectedSettings property: The extension can contain either protectedSettings or - * protectedSettingsFromKeyVault or no protected settings at all. - * - * @param protectedSettings the protectedSettings value to set. - * @return the MachineExtensionUpdate object itself. - */ - public MachineExtensionUpdate withProtectedSettings(Object protectedSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new MachineExtensionUpdateProperties(); - } - this.innerProperties().withProtectedSettings(protectedSettings); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensions.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensions.java deleted file mode 100644 index ce7e5bada03e..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensions.java +++ /dev/null @@ -1,143 +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.connectedvmware.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 MachineExtensions. */ -public interface MachineExtensions { - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String name, String extensionName); - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine where the extension should be deleted. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String name, String extensionName, Context context); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param extensionName The name of the machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension. - */ - MachineExtension get(String resourceGroupName, String name, String extensionName); - - /** - * The operation to get the extension. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String name, String extensionName, Context context); - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String name); - - /** - * The operation to get all extensions of a non-Azure machine. - * - * @param resourceGroupName The Resource Group Name. - * @param name The name of the machine containing the extension. - * @param expand The expand expression to apply on the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the Machine Extensions List Result as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String name, String expand, Context context); - - /** - * The operation to get the extension. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response}. - */ - MachineExtension getById(String id); - - /** - * The operation to get the extension. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Machine Extension along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * The operation to delete the extension. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * The operation to delete the extension. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new MachineExtension resource. - * - * @param name resource name. - * @return the first stage of the new MachineExtension definition. - */ - MachineExtension.DefinitionStages.Blank define(String name); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionsListResult.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionsListResult.java deleted file mode 100644 index 383e600da22c..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/MachineExtensionsListResult.java +++ /dev/null @@ -1,80 +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.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.MachineExtensionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the Machine Extensions List Result. */ -@Fluent -public final class MachineExtensionsListResult { - /* - * The list of extensions - */ - @JsonProperty(value = "value") - private List value; - - /* - * The uri to fetch the next page of machine extensions. Call ListNext() with this to fetch the next page of - * extensions. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of extensions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of extensions. - * - * @param value the value value to set. - * @return the MachineExtensionsListResult object itself. - */ - public MachineExtensionsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of machine extensions. Call ListNext() with this to - * fetch the next page of extensions. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The uri to fetch the next page of machine extensions. Call ListNext() with this to - * fetch the next page of extensions. - * - * @param nextLink the nextLink value to set. - * @return the MachineExtensionsListResult object itself. - */ - public MachineExtensionsListResult 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/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkInterface.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkInterface.java index 4a8fe11e139b..54b1f3ffb662 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkInterface.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkInterface.java @@ -78,6 +78,10 @@ public final class NetworkInterface { @JsonProperty(value = "ipSettings") private NicIpSettings ipSettings; + /** Creates an instance of NetworkInterface class. */ + public NetworkInterface() { + } + /** * Get the name property: Gets or sets the name of the network interface. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkInterfaceUpdate.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkInterfaceUpdate.java index 0e921741a4f9..3b9771226ae9 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkInterfaceUpdate.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkInterfaceUpdate.java @@ -40,6 +40,10 @@ public final class NetworkInterfaceUpdate { @JsonProperty(value = "deviceKey") private Integer deviceKey; + /** Creates an instance of NetworkInterfaceUpdate class. */ + public NetworkInterfaceUpdate() { + } + /** * Get the name property: Gets or sets the name of the network interface. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkProfile.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkProfile.java index efe91e666c41..abb30bed7eb0 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkProfile.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkProfile.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Specifies the network interfaces of the virtual machine. */ @Fluent public final class NetworkProfile { /* @@ -17,6 +17,10 @@ public final class NetworkProfile { @JsonProperty(value = "networkInterfaces") private List networkInterfaces; + /** Creates an instance of NetworkProfile class. */ + public NetworkProfile() { + } + /** * Get the networkInterfaces property: Gets or sets the list of network interfaces associated with the virtual * machine. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkProfileUpdate.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkProfileUpdate.java index 7c17b0807edd..0724e15499b7 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkProfileUpdate.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NetworkProfileUpdate.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the update resource properties. */ +/** Specifies the network interfaces of the virtual machine. */ @Fluent public final class NetworkProfileUpdate { /* @@ -17,6 +17,10 @@ public final class NetworkProfileUpdate { @JsonProperty(value = "networkInterfaces") private List networkInterfaces; + /** Creates an instance of NetworkProfileUpdate class. */ + public NetworkProfileUpdate() { + } + /** * Get the networkInterfaces property: Gets or sets the list of network interfaces associated with the virtual * machine. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicIpAddressSettings.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicIpAddressSettings.java index 898f9c13b3f6..0151b1610eff 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicIpAddressSettings.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicIpAddressSettings.java @@ -28,6 +28,10 @@ public final class NicIpAddressSettings { @JsonProperty(value = "subnetMask", access = JsonProperty.Access.WRITE_ONLY) private String subnetMask; + /** Creates an instance of NicIpAddressSettings class. */ + public NicIpAddressSettings() { + } + /** * Get the allocationMethod property: Gets the ip address allocation method. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicIpSettings.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicIpSettings.java index bec7b76ea6ab..d81075d7e7d8 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicIpSettings.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicIpSettings.java @@ -60,6 +60,10 @@ public final class NicIpSettings { @JsonProperty(value = "ipAddressInfo", access = JsonProperty.Access.WRITE_ONLY) private List ipAddressInfo; + /** Creates an instance of NicIpSettings class. */ + public NicIpSettings() { + } + /** * Get the allocationMethod property: Gets or sets the nic allocation method. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicType.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicType.java index 79c4fa274dcd..c9e81b9ca84d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicType.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/NicType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for NicType. */ +/** NIC type. */ public final class NicType extends ExpandableStringEnum { /** Static value vmxnet3 for NicType. */ public static final NicType VMXNET3 = fromString("vmxnet3"); @@ -28,6 +28,15 @@ public final class NicType extends ExpandableStringEnum { /** Static value pcnet32 for NicType. */ public static final NicType PCNET32 = fromString("pcnet32"); + /** + * Creates a new instance of NicType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NicType() { + } + /** * Creates or finds a NicType from its string representation. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OperationDisplay.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OperationDisplay.java index e5526d0d0da2..1ebc4abe6a0e 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OperationDisplay.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OperationDisplay.java @@ -34,6 +34,10 @@ public final class OperationDisplay { @JsonProperty(value = "description") private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: Provider name. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OperationsList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OperationsList.java index 63e1a8148afa..1d5283f2ab46 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OperationsList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OperationsList.java @@ -25,6 +25,10 @@ public final class OperationsList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of OperationsList class. */ + public OperationsList() { + } + /** * Get the nextLink property: Url to follow for getting next page of operations. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfile.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileForVMInstance.java similarity index 55% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfile.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileForVMInstance.java index e1d1806dec71..8e2ff71c12c6 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfile.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileForVMInstance.java @@ -7,9 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** Specifies the operating system settings for the virtual machine. */ @Fluent -public final class OsProfile { +public final class OsProfileForVMInstance { /* * Gets or sets computer name. */ @@ -23,7 +23,7 @@ public final class OsProfile { private String adminUsername; /* - * Gets or sets administrator password. + * Sets administrator password. */ @JsonProperty(value = "adminPassword") private String adminPassword; @@ -34,12 +34,6 @@ public final class OsProfile { @JsonProperty(value = "guestId") private String guestId; - /* - * Gets or sets a value indicating whether the VM is ready for extension operations. - */ - @JsonProperty(value = "allowExtensionOperations", access = JsonProperty.Access.WRITE_ONLY) - private Boolean allowExtensionOperations; - /* * Gets or sets the type of the os. */ @@ -47,10 +41,10 @@ public final class OsProfile { private OsType osType; /* - * Gets or sets os name. + * Gets or sets os sku. */ - @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) - private String osName; + @JsonProperty(value = "osSku", access = JsonProperty.Access.WRITE_ONLY) + private String osSku; /* * Gets or sets the current running status of VMware Tools running in the guest operating system. @@ -70,17 +64,9 @@ public final class OsProfile { @JsonProperty(value = "toolsVersion", access = JsonProperty.Access.WRITE_ONLY) private String toolsVersion; - /* - * Specifies the windows configuration for update management. - */ - @JsonProperty(value = "windowsConfiguration") - private OsProfileWindowsConfiguration windowsConfiguration; - - /* - * Specifies the linux configuration for update management. - */ - @JsonProperty(value = "linuxConfiguration") - private OsProfileLinuxConfiguration linuxConfiguration; + /** Creates an instance of OsProfileForVMInstance class. */ + public OsProfileForVMInstance() { + } /** * Get the computerName property: Gets or sets computer name. @@ -95,9 +81,9 @@ public String computerName() { * Set the computerName property: Gets or sets computer name. * * @param computerName the computerName value to set. - * @return the OsProfile object itself. + * @return the OsProfileForVMInstance object itself. */ - public OsProfile withComputerName(String computerName) { + public OsProfileForVMInstance withComputerName(String computerName) { this.computerName = computerName; return this; } @@ -115,15 +101,15 @@ public String adminUsername() { * Set the adminUsername property: Gets or sets administrator username. * * @param adminUsername the adminUsername value to set. - * @return the OsProfile object itself. + * @return the OsProfileForVMInstance object itself. */ - public OsProfile withAdminUsername(String adminUsername) { + public OsProfileForVMInstance withAdminUsername(String adminUsername) { this.adminUsername = adminUsername; return this; } /** - * Get the adminPassword property: Gets or sets administrator password. + * Get the adminPassword property: Sets administrator password. * * @return the adminPassword value. */ @@ -132,12 +118,12 @@ public String adminPassword() { } /** - * Set the adminPassword property: Gets or sets administrator password. + * Set the adminPassword property: Sets administrator password. * * @param adminPassword the adminPassword value to set. - * @return the OsProfile object itself. + * @return the OsProfileForVMInstance object itself. */ - public OsProfile withAdminPassword(String adminPassword) { + public OsProfileForVMInstance withAdminPassword(String adminPassword) { this.adminPassword = adminPassword; return this; } @@ -155,23 +141,13 @@ public String guestId() { * Set the guestId property: Gets or sets the guestId. * * @param guestId the guestId value to set. - * @return the OsProfile object itself. + * @return the OsProfileForVMInstance object itself. */ - public OsProfile withGuestId(String guestId) { + public OsProfileForVMInstance withGuestId(String guestId) { this.guestId = guestId; return this; } - /** - * Get the allowExtensionOperations property: Gets or sets a value indicating whether the VM is ready for extension - * operations. - * - * @return the allowExtensionOperations value. - */ - public Boolean allowExtensionOperations() { - return this.allowExtensionOperations; - } - /** * Get the osType property: Gets or sets the type of the os. * @@ -185,20 +161,20 @@ public OsType osType() { * Set the osType property: Gets or sets the type of the os. * * @param osType the osType value to set. - * @return the OsProfile object itself. + * @return the OsProfileForVMInstance object itself. */ - public OsProfile withOsType(OsType osType) { + public OsProfileForVMInstance withOsType(OsType osType) { this.osType = osType; return this; } /** - * Get the osName property: Gets or sets os name. + * Get the osSku property: Gets or sets os sku. * - * @return the osName value. + * @return the osSku value. */ - public String osName() { - return this.osName; + public String osSku() { + return this.osSku; } /** @@ -230,57 +206,11 @@ public String toolsVersion() { return this.toolsVersion; } - /** - * Get the windowsConfiguration property: Specifies the windows configuration for update management. - * - * @return the windowsConfiguration value. - */ - public OsProfileWindowsConfiguration windowsConfiguration() { - return this.windowsConfiguration; - } - - /** - * Set the windowsConfiguration property: Specifies the windows configuration for update management. - * - * @param windowsConfiguration the windowsConfiguration value to set. - * @return the OsProfile object itself. - */ - public OsProfile withWindowsConfiguration(OsProfileWindowsConfiguration windowsConfiguration) { - this.windowsConfiguration = windowsConfiguration; - return this; - } - - /** - * Get the linuxConfiguration property: Specifies the linux configuration for update management. - * - * @return the linuxConfiguration value. - */ - public OsProfileLinuxConfiguration linuxConfiguration() { - return this.linuxConfiguration; - } - - /** - * Set the linuxConfiguration property: Specifies the linux configuration for update management. - * - * @param linuxConfiguration the linuxConfiguration value to set. - * @return the OsProfile object itself. - */ - public OsProfile withLinuxConfiguration(OsProfileLinuxConfiguration linuxConfiguration) { - this.linuxConfiguration = linuxConfiguration; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (windowsConfiguration() != null) { - windowsConfiguration().validate(); - } - if (linuxConfiguration() != null) { - linuxConfiguration().validate(); - } } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileLinuxConfiguration.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileLinuxConfiguration.java deleted file mode 100644 index 0ecc2bdf2f92..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileLinuxConfiguration.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.PatchSettings; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the linux configuration for update management. */ -@Fluent -public final class OsProfileLinuxConfiguration { - /* - * Specifies the patch settings. - */ - @JsonProperty(value = "patchSettings") - private PatchSettings innerPatchSettings; - - /** - * Get the innerPatchSettings property: Specifies the patch settings. - * - * @return the innerPatchSettings value. - */ - private PatchSettings innerPatchSettings() { - return this.innerPatchSettings; - } - - /** - * Get the assessmentMode property: Specifies the assessment mode. - * - * @return the assessmentMode value. - */ - public String assessmentMode() { - return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); - } - - /** - * Set the assessmentMode property: Specifies the assessment mode. - * - * @param assessmentMode the assessmentMode value to set. - * @return the OsProfileLinuxConfiguration object itself. - */ - public OsProfileLinuxConfiguration withAssessmentMode(String assessmentMode) { - if (this.innerPatchSettings() == null) { - this.innerPatchSettings = new PatchSettings(); - } - this.innerPatchSettings().withAssessmentMode(assessmentMode); - return this; - } - - /** - * Get the patchMode property: Specifies the patch mode. - * - * @return the patchMode value. - */ - public String patchMode() { - return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); - } - - /** - * Set the patchMode property: Specifies the patch mode. - * - * @param patchMode the patchMode value to set. - * @return the OsProfileLinuxConfiguration object itself. - */ - public OsProfileLinuxConfiguration withPatchMode(String patchMode) { - if (this.innerPatchSettings() == null) { - this.innerPatchSettings = new PatchSettings(); - } - this.innerPatchSettings().withPatchMode(patchMode); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerPatchSettings() != null) { - innerPatchSettings().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileUpdate.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileUpdate.java deleted file mode 100644 index 23c5273c8f4b..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileUpdate.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines the os update properties. */ -@Fluent -public final class OsProfileUpdate { - /* - * Specifies the windows configuration for update management. - */ - @JsonProperty(value = "windowsConfiguration") - private OsProfileUpdateWindowsConfiguration windowsConfiguration; - - /* - * Specifies the linux configuration for update management. - */ - @JsonProperty(value = "linuxConfiguration") - private OsProfileUpdateLinuxConfiguration linuxConfiguration; - - /** - * Get the windowsConfiguration property: Specifies the windows configuration for update management. - * - * @return the windowsConfiguration value. - */ - public OsProfileUpdateWindowsConfiguration windowsConfiguration() { - return this.windowsConfiguration; - } - - /** - * Set the windowsConfiguration property: Specifies the windows configuration for update management. - * - * @param windowsConfiguration the windowsConfiguration value to set. - * @return the OsProfileUpdate object itself. - */ - public OsProfileUpdate withWindowsConfiguration(OsProfileUpdateWindowsConfiguration windowsConfiguration) { - this.windowsConfiguration = windowsConfiguration; - return this; - } - - /** - * Get the linuxConfiguration property: Specifies the linux configuration for update management. - * - * @return the linuxConfiguration value. - */ - public OsProfileUpdateLinuxConfiguration linuxConfiguration() { - return this.linuxConfiguration; - } - - /** - * Set the linuxConfiguration property: Specifies the linux configuration for update management. - * - * @param linuxConfiguration the linuxConfiguration value to set. - * @return the OsProfileUpdate object itself. - */ - public OsProfileUpdate withLinuxConfiguration(OsProfileUpdateLinuxConfiguration linuxConfiguration) { - this.linuxConfiguration = linuxConfiguration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (windowsConfiguration() != null) { - windowsConfiguration().validate(); - } - if (linuxConfiguration() != null) { - linuxConfiguration().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileUpdateLinuxConfiguration.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileUpdateLinuxConfiguration.java deleted file mode 100644 index 1af2c92b2fc8..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileUpdateLinuxConfiguration.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.PatchSettings; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the linux configuration for update management. */ -@Fluent -public final class OsProfileUpdateLinuxConfiguration { - /* - * Specifies the patch settings. - */ - @JsonProperty(value = "patchSettings") - private PatchSettings innerPatchSettings; - - /** - * Get the innerPatchSettings property: Specifies the patch settings. - * - * @return the innerPatchSettings value. - */ - private PatchSettings innerPatchSettings() { - return this.innerPatchSettings; - } - - /** - * Get the assessmentMode property: Specifies the assessment mode. - * - * @return the assessmentMode value. - */ - public String assessmentMode() { - return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); - } - - /** - * Set the assessmentMode property: Specifies the assessment mode. - * - * @param assessmentMode the assessmentMode value to set. - * @return the OsProfileUpdateLinuxConfiguration object itself. - */ - public OsProfileUpdateLinuxConfiguration withAssessmentMode(String assessmentMode) { - if (this.innerPatchSettings() == null) { - this.innerPatchSettings = new PatchSettings(); - } - this.innerPatchSettings().withAssessmentMode(assessmentMode); - return this; - } - - /** - * Get the patchMode property: Specifies the patch mode. - * - * @return the patchMode value. - */ - public String patchMode() { - return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); - } - - /** - * Set the patchMode property: Specifies the patch mode. - * - * @param patchMode the patchMode value to set. - * @return the OsProfileUpdateLinuxConfiguration object itself. - */ - public OsProfileUpdateLinuxConfiguration withPatchMode(String patchMode) { - if (this.innerPatchSettings() == null) { - this.innerPatchSettings = new PatchSettings(); - } - this.innerPatchSettings().withPatchMode(patchMode); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerPatchSettings() != null) { - innerPatchSettings().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileUpdateWindowsConfiguration.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileUpdateWindowsConfiguration.java deleted file mode 100644 index baed71620156..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileUpdateWindowsConfiguration.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.PatchSettings; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the windows configuration for update management. */ -@Fluent -public final class OsProfileUpdateWindowsConfiguration { - /* - * Specifies the patch settings. - */ - @JsonProperty(value = "patchSettings") - private PatchSettings innerPatchSettings; - - /** - * Get the innerPatchSettings property: Specifies the patch settings. - * - * @return the innerPatchSettings value. - */ - private PatchSettings innerPatchSettings() { - return this.innerPatchSettings; - } - - /** - * Get the assessmentMode property: Specifies the assessment mode. - * - * @return the assessmentMode value. - */ - public String assessmentMode() { - return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); - } - - /** - * Set the assessmentMode property: Specifies the assessment mode. - * - * @param assessmentMode the assessmentMode value to set. - * @return the OsProfileUpdateWindowsConfiguration object itself. - */ - public OsProfileUpdateWindowsConfiguration withAssessmentMode(String assessmentMode) { - if (this.innerPatchSettings() == null) { - this.innerPatchSettings = new PatchSettings(); - } - this.innerPatchSettings().withAssessmentMode(assessmentMode); - return this; - } - - /** - * Get the patchMode property: Specifies the patch mode. - * - * @return the patchMode value. - */ - public String patchMode() { - return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); - } - - /** - * Set the patchMode property: Specifies the patch mode. - * - * @param patchMode the patchMode value to set. - * @return the OsProfileUpdateWindowsConfiguration object itself. - */ - public OsProfileUpdateWindowsConfiguration withPatchMode(String patchMode) { - if (this.innerPatchSettings() == null) { - this.innerPatchSettings = new PatchSettings(); - } - this.innerPatchSettings().withPatchMode(patchMode); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerPatchSettings() != null) { - innerPatchSettings().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileWindowsConfiguration.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileWindowsConfiguration.java deleted file mode 100644 index 00f4600cac90..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsProfileWindowsConfiguration.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.PatchSettings; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the windows configuration for update management. */ -@Fluent -public final class OsProfileWindowsConfiguration { - /* - * Specifies the patch settings. - */ - @JsonProperty(value = "patchSettings") - private PatchSettings innerPatchSettings; - - /** - * Get the innerPatchSettings property: Specifies the patch settings. - * - * @return the innerPatchSettings value. - */ - private PatchSettings innerPatchSettings() { - return this.innerPatchSettings; - } - - /** - * Get the assessmentMode property: Specifies the assessment mode. - * - * @return the assessmentMode value. - */ - public String assessmentMode() { - return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); - } - - /** - * Set the assessmentMode property: Specifies the assessment mode. - * - * @param assessmentMode the assessmentMode value to set. - * @return the OsProfileWindowsConfiguration object itself. - */ - public OsProfileWindowsConfiguration withAssessmentMode(String assessmentMode) { - if (this.innerPatchSettings() == null) { - this.innerPatchSettings = new PatchSettings(); - } - this.innerPatchSettings().withAssessmentMode(assessmentMode); - return this; - } - - /** - * Get the patchMode property: Specifies the patch mode. - * - * @return the patchMode value. - */ - public String patchMode() { - return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); - } - - /** - * Set the patchMode property: Specifies the patch mode. - * - * @param patchMode the patchMode value to set. - * @return the OsProfileWindowsConfiguration object itself. - */ - public OsProfileWindowsConfiguration withPatchMode(String patchMode) { - if (this.innerPatchSettings() == null) { - this.innerPatchSettings = new PatchSettings(); - } - this.innerPatchSettings().withPatchMode(patchMode); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerPatchSettings() != null) { - innerPatchSettings().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsType.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsType.java index bdb233316b4e..f1cd4f44a55d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsType.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for OsType. */ +/** Defines the different types of VM guest operating systems. */ public final class OsType extends ExpandableStringEnum { /** Static value Windows for OsType. */ public static final OsType WINDOWS = fromString("Windows"); @@ -19,6 +19,15 @@ public final class OsType extends ExpandableStringEnum { /** Static value Other for OsType. */ public static final OsType OTHER = fromString("Other"); + /** + * Creates a new instance of OsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OsType() { + } + /** * Creates or finds a OsType from its string representation. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsTypeUM.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsTypeUM.java deleted file mode 100644 index 8ce706aeb5c3..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/OsTypeUM.java +++ /dev/null @@ -1,38 +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.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OsTypeUM. */ -public final class OsTypeUM extends ExpandableStringEnum { - /** Static value Windows for OsTypeUM. */ - public static final OsTypeUM WINDOWS = fromString("Windows"); - - /** Static value Linux for OsTypeUM. */ - public static final OsTypeUM LINUX = fromString("Linux"); - - /** - * Creates or finds a OsTypeUM from its string representation. - * - * @param name a name to look for. - * @return the corresponding OsTypeUM. - */ - @JsonCreator - public static OsTypeUM fromString(String name) { - return fromString(name, OsTypeUM.class); - } - - /** - * Gets known OsTypeUM values. - * - * @return known OsTypeUM values. - */ - public static Collection values() { - return values(OsTypeUM.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PatchOperationStartedBy.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PatchOperationStartedBy.java deleted file mode 100644 index f1875a7a4ebf..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PatchOperationStartedBy.java +++ /dev/null @@ -1,38 +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.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PatchOperationStartedBy. */ -public final class PatchOperationStartedBy extends ExpandableStringEnum { - /** Static value User for PatchOperationStartedBy. */ - public static final PatchOperationStartedBy USER = fromString("User"); - - /** Static value Platform for PatchOperationStartedBy. */ - public static final PatchOperationStartedBy PLATFORM = fromString("Platform"); - - /** - * Creates or finds a PatchOperationStartedBy from its string representation. - * - * @param name a name to look for. - * @return the corresponding PatchOperationStartedBy. - */ - @JsonCreator - public static PatchOperationStartedBy fromString(String name) { - return fromString(name, PatchOperationStartedBy.class); - } - - /** - * Gets known PatchOperationStartedBy values. - * - * @return known PatchOperationStartedBy values. - */ - public static Collection values() { - return values(PatchOperationStartedBy.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PatchOperationStatus.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PatchOperationStatus.java deleted file mode 100644 index ac795c5732de..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PatchOperationStatus.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PatchOperationStatus. */ -public final class PatchOperationStatus extends ExpandableStringEnum { - /** Static value Unknown for PatchOperationStatus. */ - public static final PatchOperationStatus UNKNOWN = fromString("Unknown"); - - /** Static value InProgress for PatchOperationStatus. */ - public static final PatchOperationStatus IN_PROGRESS = fromString("InProgress"); - - /** Static value Failed for PatchOperationStatus. */ - public static final PatchOperationStatus FAILED = fromString("Failed"); - - /** Static value Succeeded for PatchOperationStatus. */ - public static final PatchOperationStatus SUCCEEDED = fromString("Succeeded"); - - /** Static value CompletedWithWarnings for PatchOperationStatus. */ - public static final PatchOperationStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); - - /** - * Creates or finds a PatchOperationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PatchOperationStatus. - */ - @JsonCreator - public static PatchOperationStatus fromString(String name) { - return fromString(name, PatchOperationStatus.class); - } - - /** - * Gets known PatchOperationStatus values. - * - * @return known PatchOperationStatus values. - */ - public static Collection values() { - return values(PatchOperationStatus.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PatchServiceUsed.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PatchServiceUsed.java deleted file mode 100644 index f7204b5d57a7..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PatchServiceUsed.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PatchServiceUsed. */ -public final class PatchServiceUsed extends ExpandableStringEnum { - /** Static value Unknown for PatchServiceUsed. */ - public static final PatchServiceUsed UNKNOWN = fromString("Unknown"); - - /** Static value WU for PatchServiceUsed. */ - public static final PatchServiceUsed WU = fromString("WU"); - - /** Static value WU_WSUS for PatchServiceUsed. */ - public static final PatchServiceUsed WU_WSUS = fromString("WU_WSUS"); - - /** Static value YUM for PatchServiceUsed. */ - public static final PatchServiceUsed YUM = fromString("YUM"); - - /** Static value APT for PatchServiceUsed. */ - public static final PatchServiceUsed APT = fromString("APT"); - - /** Static value Zypper for PatchServiceUsed. */ - public static final PatchServiceUsed ZYPPER = fromString("Zypper"); - - /** - * Creates or finds a PatchServiceUsed from its string representation. - * - * @param name a name to look for. - * @return the corresponding PatchServiceUsed. - */ - @JsonCreator - public static PatchServiceUsed fromString(String name) { - return fromString(name, PatchServiceUsed.class); - } - - /** - * Gets known PatchServiceUsed values. - * - * @return known PatchServiceUsed values. - */ - public static Collection values() { - return values(PatchServiceUsed.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PlacementProfile.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PlacementProfile.java index 82b2c30d722b..b38614856fc7 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PlacementProfile.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PlacementProfile.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** Specifies the compute and storage placement settings for the virtual machine. */ @Fluent public final class PlacementProfile { /* @@ -34,6 +34,10 @@ public final class PlacementProfile { @JsonProperty(value = "datastoreId") private String datastoreId; + /** Creates an instance of PlacementProfile class. */ + public PlacementProfile() { + } + /** * Get the resourcePoolId property: Gets or sets the ARM Id of the resourcePool resource on which this virtual * machine will deploy. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PowerOnBootOption.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PowerOnBootOption.java index fd2aab259061..1e8563e3be01 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PowerOnBootOption.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/PowerOnBootOption.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for PowerOnBootOption. */ +/** Defines the options for power on boot. */ public final class PowerOnBootOption extends ExpandableStringEnum { /** Static value enabled for PowerOnBootOption. */ public static final PowerOnBootOption ENABLED = fromString("enabled"); @@ -16,6 +16,15 @@ public final class PowerOnBootOption extends ExpandableStringEnum { /** Static value install for ProvisioningAction. */ public static final ProvisioningAction INSTALL = fromString("install"); @@ -19,6 +19,15 @@ public final class ProvisioningAction extends ExpandableStringEnum { /** Static value Succeeded for ProvisioningState. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); @@ -34,6 +34,15 @@ public final class ProvisioningState extends ExpandableStringEnum tags; + /** Creates an instance of ResourcePatch class. */ + public ResourcePatch() { + } + /** * Get the tags property: Resource tags. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePool.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePool.java index 67e89bf30146..c46f8dd71360 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePool.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePool.java @@ -154,6 +154,34 @@ public interface ResourcePool { */ Long memLimitMB(); + /** + * Gets the memOverallUsageGB property: Gets the used physical memory on the pool in GB. + * + * @return the memOverallUsageGB value. + */ + Long memOverallUsageGB(); + + /** + * Gets the memCapacityGB property: Gets the total amount of physical memory on the pool in GB. + * + * @return the memCapacityGB value. + */ + Long memCapacityGB(); + + /** + * Gets the cpuOverallUsageMHz property: Gets the used CPU usage across all cores on the pool in MHz. + * + * @return the cpuOverallUsageMHz value. + */ + Long cpuOverallUsageMHz(); + + /** + * Gets the cpuCapacityMHz property: Gets the max CPU usage across all cores on the pool in MHz. + * + * @return the cpuCapacityMHz value. + */ + Long cpuCapacityMHz(); + /** * Gets the customResourceName property: Gets the name of the corresponding resource in Kubernetes. * @@ -161,6 +189,20 @@ public interface ResourcePool { */ String customResourceName(); + /** + * Gets the datastoreIds property: Gets the datastore ARM ids. + * + * @return the datastoreIds value. + */ + List datastoreIds(); + + /** + * Gets the networkIds property: Gets the network ARM ids. + * + * @return the networkIds value. + */ + List networkIds(); + /** * Gets the statuses property: The resource status information. * @@ -169,11 +211,11 @@ public interface ResourcePool { List statuses(); /** - * Gets the provisioningState property: Gets or sets the provisioning state. + * Gets the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - String provisioningState(); + ProvisioningState provisioningState(); /** * Gets the region of the resource. @@ -210,11 +252,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The ResourcePool definition stages. */ interface DefinitionStages { /** The first stage of the ResourcePool definition. */ interface Blank extends WithLocation { } + /** The stage of the ResourcePool definition allowing to specify location. */ interface WithLocation { /** @@ -233,6 +277,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the ResourcePool definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -243,6 +288,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the ResourcePool 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. @@ -269,6 +315,7 @@ interface WithCreate */ ResourcePool create(Context context); } + /** The stage of the ResourcePool definition allowing to specify tags. */ interface WithTags { /** @@ -279,6 +326,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the ResourcePool definition allowing to specify extendedLocation. */ interface WithExtendedLocation { /** @@ -289,6 +337,7 @@ interface WithExtendedLocation { */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** The stage of the ResourcePool definition allowing to specify kind. */ interface WithKind { /** @@ -303,6 +352,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the ResourcePool definition allowing to specify vCenterId. */ interface WithVCenterId { /** @@ -314,6 +364,7 @@ interface WithVCenterId { */ WithCreate withVCenterId(String vCenterId); } + /** The stage of the ResourcePool definition allowing to specify moRefId. */ interface WithMoRefId { /** @@ -325,6 +376,7 @@ interface WithMoRefId { */ WithCreate withMoRefId(String moRefId); } + /** The stage of the ResourcePool definition allowing to specify inventoryItemId. */ interface WithInventoryItemId { /** @@ -336,6 +388,7 @@ interface WithInventoryItemId { WithCreate withInventoryItemId(String inventoryItemId); } } + /** * Begins update for the ResourcePool resource. * @@ -360,6 +413,7 @@ interface Update extends UpdateStages.WithTags { */ ResourcePool apply(Context context); } + /** The ResourcePool update stages. */ interface UpdateStages { /** The stage of the ResourcePool update allowing to specify tags. */ @@ -373,6 +427,7 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePoolInventoryItem.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePoolInventoryItem.java index 9ab151f1186f..aa5c5fa8b877 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePoolInventoryItem.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePoolInventoryItem.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.connectedvmware.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -21,6 +20,10 @@ public final class ResourcePoolInventoryItem extends InventoryItemProperties { @JsonProperty(value = "parent") private InventoryItemDetails parent; + /** Creates an instance of ResourcePoolInventoryItem class. */ + public ResourcePoolInventoryItem() { + } + /** * Get the parent property: Parent resourcePool inventory resource details. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePools.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePools.java index 34bd4274ef7a..b379aa2776e7 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePools.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePools.java @@ -10,20 +10,6 @@ /** Resource collection API of ResourcePools. */ public interface ResourcePools { - /** - * Gets a resourcePool. - * - *

Implements resourcePool GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param resourcePoolName Name of the resourcePool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the resourcePool. - */ - ResourcePool getByResourceGroup(String resourceGroupName, String resourcePoolName); - /** * Gets a resourcePool. * @@ -41,18 +27,18 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String resourcePoolName, Context context); /** - * Deletes an resourcePool. + * Gets a resourcePool. * - *

Implements resourcePool DELETE method. + *

Implements resourcePool GET method. * * @param resourceGroupName The Resource Group Name. * @param resourcePoolName Name of the resourcePool. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the resourcePool. */ - void delete(String resourceGroupName, String resourcePoolName, Boolean force); + ResourcePool getByResourceGroup(String resourceGroupName, String resourcePoolName); /** * Deletes an resourcePool. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePoolsList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePoolsList.java index 76f36b8d609b..89cfa168da31 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePoolsList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourcePoolsList.java @@ -25,6 +25,10 @@ public final class ResourcePoolsList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of ResourcePoolsList class. */ + public ResourcePoolsList() { + } + /** * Get the nextLink property: Url to follow for getting next page of ResourcePools. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourceStatus.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourceStatus.java index 4a4db2c1d243..d294c71b0acf 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourceStatus.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ResourceStatus.java @@ -47,6 +47,10 @@ public final class ResourceStatus { @JsonProperty(value = "lastUpdatedAt", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastUpdatedAt; + /** Creates an instance of ResourceStatus class. */ + public ResourceStatus() { + } + /** * Get the type property: The type of the condition. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ScsiControllerType.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ScsiControllerType.java index d2978cfd4dc2..7dd8c64a3c7c 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ScsiControllerType.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/ScsiControllerType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ScsiControllerType. */ +/** Defines the different types of SCSI controllers. */ public final class ScsiControllerType extends ExpandableStringEnum { /** Static value lsilogic for ScsiControllerType. */ public static final ScsiControllerType LSILOGIC = fromString("lsilogic"); @@ -22,6 +22,15 @@ public final class ScsiControllerType extends ExpandableStringEnum { - /** Static value Info for StatusLevelTypes. */ - public static final StatusLevelTypes INFO = fromString("Info"); - - /** Static value Warning for StatusLevelTypes. */ - public static final StatusLevelTypes WARNING = fromString("Warning"); - - /** Static value Error for StatusLevelTypes. */ - public static final StatusLevelTypes ERROR = fromString("Error"); - - /** - * Creates or finds a StatusLevelTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding StatusLevelTypes. - */ - @JsonCreator - public static StatusLevelTypes fromString(String name) { - return fromString(name, StatusLevelTypes.class); - } - - /** - * Gets known StatusLevelTypes values. - * - * @return known StatusLevelTypes values. - */ - public static Collection values() { - return values(StatusLevelTypes.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StatusTypes.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StatusTypes.java deleted file mode 100644 index ce0146622c31..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StatusTypes.java +++ /dev/null @@ -1,41 +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.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for StatusTypes. */ -public final class StatusTypes extends ExpandableStringEnum { - /** Static value Connected for StatusTypes. */ - public static final StatusTypes CONNECTED = fromString("Connected"); - - /** Static value Disconnected for StatusTypes. */ - public static final StatusTypes DISCONNECTED = fromString("Disconnected"); - - /** Static value Error for StatusTypes. */ - public static final StatusTypes ERROR = fromString("Error"); - - /** - * Creates or finds a StatusTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding StatusTypes. - */ - @JsonCreator - public static StatusTypes fromString(String name) { - return fromString(name, StatusTypes.class); - } - - /** - * Gets known StatusTypes values. - * - * @return known StatusTypes values. - */ - public static Collection values() { - return values(StatusTypes.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StopVirtualMachineOptions.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StopVirtualMachineOptions.java index 18a2cfcfdd0d..1b07ca74a04b 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StopVirtualMachineOptions.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StopVirtualMachineOptions.java @@ -17,6 +17,10 @@ public final class StopVirtualMachineOptions { @JsonProperty(value = "skipShutdown") private Boolean skipShutdown; + /** Creates an instance of StopVirtualMachineOptions class. */ + public StopVirtualMachineOptions() { + } + /** * Get the skipShutdown property: Gets or sets a value indicating whether to request non-graceful VM shutdown. True * value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Defaults to false. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StorageProfile.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StorageProfile.java index 3e10473ef0e2..994c4fd500c5 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StorageProfile.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StorageProfile.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** Specifies the storage settings for the virtual machine disks. */ @Fluent public final class StorageProfile { /* @@ -23,6 +23,10 @@ public final class StorageProfile { @JsonProperty(value = "scsiControllers", access = JsonProperty.Access.WRITE_ONLY) private List scsiControllers; + /** Creates an instance of StorageProfile class. */ + public StorageProfile() { + } + /** * Get the disks property: Gets or sets the list of virtual disks associated with the virtual machine. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StorageProfileUpdate.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StorageProfileUpdate.java index 2854ada3445d..7f5b964e78a3 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StorageProfileUpdate.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/StorageProfileUpdate.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource update properties. */ +/** Specifies the storage settings for the virtual machine disks. */ @Fluent public final class StorageProfileUpdate { /* @@ -17,6 +17,10 @@ public final class StorageProfileUpdate { @JsonProperty(value = "disks") private List disks; + /** Creates an instance of StorageProfileUpdate class. */ + public StorageProfileUpdate() { + } + /** * Get the disks property: Gets or sets the list of virtual disks associated with the virtual machine. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/UefiSettings.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/UefiSettings.java index fa02a39e3859..0be25b30689f 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/UefiSettings.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/UefiSettings.java @@ -16,6 +16,10 @@ public final class UefiSettings { @JsonProperty(value = "secureBootEnabled") private Boolean secureBootEnabled; + /** Creates an instance of UefiSettings class. */ + public UefiSettings() { + } + /** * Get the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCenter.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCenter.java index 2efe8b1fece0..cf79a2f89e9e 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCenter.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCenter.java @@ -135,11 +135,11 @@ public interface VCenter { List statuses(); /** - * Gets the provisioningState property: Gets or sets the provisioning state. + * Gets the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - String provisioningState(); + ProvisioningState provisioningState(); /** * Gets the region of the resource. @@ -177,11 +177,13 @@ interface Definition DefinitionStages.WithFqdn, DefinitionStages.WithCreate { } + /** The VCenter definition stages. */ interface DefinitionStages { /** The first stage of the VCenter definition. */ interface Blank extends WithLocation { } + /** The stage of the VCenter definition allowing to specify location. */ interface WithLocation { /** @@ -200,6 +202,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the VCenter definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -210,6 +213,7 @@ interface WithResourceGroup { */ WithFqdn withExistingResourceGroup(String resourceGroupName); } + /** The stage of the VCenter definition allowing to specify fqdn. */ interface WithFqdn { /** @@ -220,6 +224,7 @@ interface WithFqdn { */ WithCreate withFqdn(String fqdn); } + /** * The stage of the VCenter 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. @@ -245,6 +250,7 @@ interface WithCreate */ VCenter create(Context context); } + /** The stage of the VCenter definition allowing to specify tags. */ interface WithTags { /** @@ -255,6 +261,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the VCenter definition allowing to specify extendedLocation. */ interface WithExtendedLocation { /** @@ -265,6 +272,7 @@ interface WithExtendedLocation { */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** The stage of the VCenter definition allowing to specify kind. */ interface WithKind { /** @@ -279,6 +287,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the VCenter definition allowing to specify port. */ interface WithPort { /** @@ -289,6 +298,7 @@ interface WithPort { */ WithCreate withPort(Integer port); } + /** The stage of the VCenter definition allowing to specify credentials. */ interface WithCredentials { /** @@ -300,6 +310,7 @@ interface WithCredentials { WithCreate withCredentials(VICredential credentials); } } + /** * Begins update for the VCenter resource. * @@ -324,6 +335,7 @@ interface Update extends UpdateStages.WithTags { */ VCenter apply(Context context); } + /** The VCenter update stages. */ interface UpdateStages { /** The stage of the VCenter update allowing to specify tags. */ @@ -337,6 +349,7 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCenters.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCenters.java index 3bb248d29743..989cc0c3baa1 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCenters.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCenters.java @@ -10,20 +10,6 @@ /** Resource collection API of VCenters. */ public interface VCenters { - /** - * Gets a vCenter. - * - *

Implements vCenter GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param vcenterName Name of the vCenter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the vCenter. - */ - VCenter getByResourceGroup(String resourceGroupName, String vcenterName); - /** * Gets a vCenter. * @@ -40,18 +26,18 @@ public interface VCenters { Response getByResourceGroupWithResponse(String resourceGroupName, String vcenterName, Context context); /** - * Deletes an vCenter. + * Gets a vCenter. * - *

Implements vCenter DELETE method. + *

Implements vCenter GET method. * * @param resourceGroupName The Resource Group Name. * @param vcenterName Name of the vCenter. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the vCenter. */ - void delete(String resourceGroupName, String vcenterName, Boolean force); + VCenter getByResourceGroup(String resourceGroupName, String vcenterName); /** * Deletes an vCenter. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCentersList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCentersList.java index 1e012f4753d5..a7e4ec2bc428 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCentersList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VCentersList.java @@ -25,6 +25,10 @@ public final class VCentersList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of VCentersList class. */ + public VCentersList() { + } + /** * Get the nextLink property: Url to follow for getting next page of VCenters. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VICredential.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VICredential.java index 3cdc03a69cba..5fbd01d60355 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VICredential.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VICredential.java @@ -22,6 +22,10 @@ public final class VICredential { @JsonProperty(value = "password") private String password; + /** Creates an instance of VICredential class. */ + public VICredential() { + } + /** * Get the username property: Gets or sets username to connect with the vCenter. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchClassificationLinux.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchClassificationLinux.java deleted file mode 100644 index 217334fdc809..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchClassificationLinux.java +++ /dev/null @@ -1,41 +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.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VMGuestPatchClassificationLinux. */ -public final class VMGuestPatchClassificationLinux extends ExpandableStringEnum { - /** Static value Critical for VMGuestPatchClassificationLinux. */ - public static final VMGuestPatchClassificationLinux CRITICAL = fromString("Critical"); - - /** Static value Security for VMGuestPatchClassificationLinux. */ - public static final VMGuestPatchClassificationLinux SECURITY = fromString("Security"); - - /** Static value Other for VMGuestPatchClassificationLinux. */ - public static final VMGuestPatchClassificationLinux OTHER = fromString("Other"); - - /** - * Creates or finds a VMGuestPatchClassificationLinux from its string representation. - * - * @param name a name to look for. - * @return the corresponding VMGuestPatchClassificationLinux. - */ - @JsonCreator - public static VMGuestPatchClassificationLinux fromString(String name) { - return fromString(name, VMGuestPatchClassificationLinux.class); - } - - /** - * Gets known VMGuestPatchClassificationLinux values. - * - * @return known VMGuestPatchClassificationLinux values. - */ - public static Collection values() { - return values(VMGuestPatchClassificationLinux.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchClassificationWindows.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchClassificationWindows.java deleted file mode 100644 index 13119c29c8d4..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchClassificationWindows.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VMGuestPatchClassificationWindows. */ -public final class VMGuestPatchClassificationWindows extends ExpandableStringEnum { - /** Static value Critical for VMGuestPatchClassificationWindows. */ - public static final VMGuestPatchClassificationWindows CRITICAL = fromString("Critical"); - - /** Static value Security for VMGuestPatchClassificationWindows. */ - public static final VMGuestPatchClassificationWindows SECURITY = fromString("Security"); - - /** Static value UpdateRollUp for VMGuestPatchClassificationWindows. */ - public static final VMGuestPatchClassificationWindows UPDATE_ROLL_UP = fromString("UpdateRollUp"); - - /** Static value FeaturePack for VMGuestPatchClassificationWindows. */ - public static final VMGuestPatchClassificationWindows FEATURE_PACK = fromString("FeaturePack"); - - /** Static value ServicePack for VMGuestPatchClassificationWindows. */ - public static final VMGuestPatchClassificationWindows SERVICE_PACK = fromString("ServicePack"); - - /** Static value Definition for VMGuestPatchClassificationWindows. */ - public static final VMGuestPatchClassificationWindows DEFINITION = fromString("Definition"); - - /** Static value Tools for VMGuestPatchClassificationWindows. */ - public static final VMGuestPatchClassificationWindows TOOLS = fromString("Tools"); - - /** Static value Updates for VMGuestPatchClassificationWindows. */ - public static final VMGuestPatchClassificationWindows UPDATES = fromString("Updates"); - - /** - * Creates or finds a VMGuestPatchClassificationWindows from its string representation. - * - * @param name a name to look for. - * @return the corresponding VMGuestPatchClassificationWindows. - */ - @JsonCreator - public static VMGuestPatchClassificationWindows fromString(String name) { - return fromString(name, VMGuestPatchClassificationWindows.class); - } - - /** - * Gets known VMGuestPatchClassificationWindows values. - * - * @return known VMGuestPatchClassificationWindows values. - */ - public static Collection values() { - return values(VMGuestPatchClassificationWindows.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchRebootSetting.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchRebootSetting.java deleted file mode 100644 index fd0cd294bbe9..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchRebootSetting.java +++ /dev/null @@ -1,41 +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.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VMGuestPatchRebootSetting. */ -public final class VMGuestPatchRebootSetting extends ExpandableStringEnum { - /** Static value IfRequired for VMGuestPatchRebootSetting. */ - public static final VMGuestPatchRebootSetting IF_REQUIRED = fromString("IfRequired"); - - /** Static value Never for VMGuestPatchRebootSetting. */ - public static final VMGuestPatchRebootSetting NEVER = fromString("Never"); - - /** Static value Always for VMGuestPatchRebootSetting. */ - public static final VMGuestPatchRebootSetting ALWAYS = fromString("Always"); - - /** - * Creates or finds a VMGuestPatchRebootSetting from its string representation. - * - * @param name a name to look for. - * @return the corresponding VMGuestPatchRebootSetting. - */ - @JsonCreator - public static VMGuestPatchRebootSetting fromString(String name) { - return fromString(name, VMGuestPatchRebootSetting.class); - } - - /** - * Gets known VMGuestPatchRebootSetting values. - * - * @return known VMGuestPatchRebootSetting values. - */ - public static Collection values() { - return values(VMGuestPatchRebootSetting.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchRebootStatus.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchRebootStatus.java deleted file mode 100644 index e81344ab05d8..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMGuestPatchRebootStatus.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for VMGuestPatchRebootStatus. */ -public final class VMGuestPatchRebootStatus extends ExpandableStringEnum { - /** Static value Unknown for VMGuestPatchRebootStatus. */ - public static final VMGuestPatchRebootStatus UNKNOWN = fromString("Unknown"); - - /** Static value NotNeeded for VMGuestPatchRebootStatus. */ - public static final VMGuestPatchRebootStatus NOT_NEEDED = fromString("NotNeeded"); - - /** Static value Required for VMGuestPatchRebootStatus. */ - public static final VMGuestPatchRebootStatus REQUIRED = fromString("Required"); - - /** Static value Started for VMGuestPatchRebootStatus. */ - public static final VMGuestPatchRebootStatus STARTED = fromString("Started"); - - /** Static value Failed for VMGuestPatchRebootStatus. */ - public static final VMGuestPatchRebootStatus FAILED = fromString("Failed"); - - /** Static value Completed for VMGuestPatchRebootStatus. */ - public static final VMGuestPatchRebootStatus COMPLETED = fromString("Completed"); - - /** - * Creates or finds a VMGuestPatchRebootStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding VMGuestPatchRebootStatus. - */ - @JsonCreator - public static VMGuestPatchRebootStatus fromString(String name) { - return fromString(name, VMGuestPatchRebootStatus.class); - } - - /** - * Gets known VMGuestPatchRebootStatus values. - * - * @return known VMGuestPatchRebootStatus values. - */ - public static Collection values() { - return values(VMGuestPatchRebootStatus.class); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgents.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMInstanceGuestAgents.java similarity index 55% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgents.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMInstanceGuestAgents.java index 0b8d94fe60d1..78ee039946ce 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/GuestAgents.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VMInstanceGuestAgents.java @@ -7,156 +7,122 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner; -/** Resource collection API of GuestAgents. */ -public interface GuestAgents { +/** Resource collection API of VMInstanceGuestAgents. */ +public interface VMInstanceGuestAgents { /** - * Gets GuestAgent. + * Implements GuestAgent PUT method. * - *

Implements GuestAgent GET method. + *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the GuestAgent. */ - GuestAgent get(String resourceGroupName, String virtualMachineName, String name); + GuestAgent create(String resourceUri); /** - * Gets GuestAgent. + * Implements GuestAgent PUT method. * - *

Implements GuestAgent GET method. + *

Create Or Update GuestAgent. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. * @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 defines the GuestAgent along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String virtualMachineName, String name, Context context); - - /** - * Deletes an GuestAgent. - * - *

Implements GuestAgent DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent. */ - void delete(String resourceGroupName, String virtualMachineName, String name); + GuestAgent create(String resourceUri, GuestAgentInner body, Context context); /** - * Deletes an GuestAgent. + * Gets GuestAgent. * - *

Implements GuestAgent DELETE method. + *

Implements GuestAgent GET method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param name Name of the GuestAgent. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @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 defines the GuestAgent along with {@link Response}. */ - void delete(String resourceGroupName, String virtualMachineName, String name, Context context); - - /** - * Implements GET GuestAgent in a vm. - * - *

Returns the list of GuestAgent of the given vm. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 GuestAgent as paginated response with {@link PagedIterable}. - */ - PagedIterable listByVm(String resourceGroupName, String virtualMachineName); + Response getWithResponse(String resourceUri, Context context); /** - * Implements GET GuestAgent in a vm. + * Gets GuestAgent. * - *

Returns the list of GuestAgent of the given vm. + *

Implements GuestAgent GET method. * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the vm. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 GuestAgent as paginated response with {@link PagedIterable}. + * @return defines the GuestAgent. */ - PagedIterable listByVm(String resourceGroupName, String virtualMachineName, Context context); + GuestAgent get(String resourceUri); /** - * Gets GuestAgent. + * Deletes an GuestAgent. * - *

Implements GuestAgent GET method. + *

Implements GuestAgent DELETE method. * - * @param id the resource ID. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the GuestAgent along with {@link Response}. */ - GuestAgent getById(String id); + void delete(String resourceUri); /** - * Gets GuestAgent. + * Deletes an GuestAgent. * - *

Implements GuestAgent GET method. + *

Implements GuestAgent DELETE method. * - * @param id the resource ID. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @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 defines the GuestAgent along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + void delete(String resourceUri, Context context); /** - * Deletes an GuestAgent. + * Implements GET GuestAgent in a vm. * - *

Implements GuestAgent DELETE method. + *

Returns the list of GuestAgent of the given vm. * - * @param id the resource ID. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 GuestAgent as paginated response with {@link PagedIterable}. */ - void deleteById(String id); + PagedIterable list(String resourceUri); /** - * Deletes an GuestAgent. + * Implements GET GuestAgent in a vm. * - *

Implements GuestAgent DELETE method. + *

Returns the list of GuestAgent of the given vm. * - * @param id the resource ID. + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. * @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 GuestAgent as paginated response with {@link PagedIterable}. */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new GuestAgent resource. - * - * @param name resource name. - * @return the first stage of the new GuestAgent definition. - */ - GuestAgent.DefinitionStages.Blank define(String name); + PagedIterable list(String resourceUri, Context context); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualDisk.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualDisk.java index a8ac5ebb3903..8c9625f7dc1e 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualDisk.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualDisk.java @@ -70,6 +70,10 @@ public final class VirtualDisk { @JsonProperty(value = "diskType") private DiskType diskType; + /** Creates an instance of VirtualDisk class. */ + public VirtualDisk() { + } + /** * Get the name property: Gets or sets the name of the virtual disk. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualDiskUpdate.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualDiskUpdate.java index aebdf04966ae..6da5b2c8d8b0 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualDiskUpdate.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualDiskUpdate.java @@ -58,6 +58,10 @@ public final class VirtualDiskUpdate { @JsonProperty(value = "diskType") private DiskType diskType; + /** Creates an instance of VirtualDiskUpdate class. */ + public VirtualDiskUpdate() { + } + /** * Get the name property: Gets or sets the name of the virtual disk. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachine.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachine.java deleted file mode 100644 index 10d0c84f04ca..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachine.java +++ /dev/null @@ -1,725 +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.connectedvmware.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInner; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of VirtualMachine. */ -public interface VirtualMachine { - /** - * 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 extendedLocation property: Gets or sets the extended location. - * - * @return the extendedLocation value. - */ - ExtendedLocation extendedLocation(); - - /** - * Gets the systemData property: The system data. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must - * validate and persist this value. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the identity property: The identity of the resource. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the resourcePoolId property: Gets or sets the ARM Id of the resourcePool resource on which this virtual - * machine will deploy. - * - * @return the resourcePoolId value. - */ - String resourcePoolId(); - - /** - * Gets the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual machine. - * - * @return the templateId value. - */ - String templateId(); - - /** - * Gets the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. - * - * @return the vCenterId value. - */ - String vCenterId(); - - /** - * Gets the placementProfile property: Placement properties. - * - * @return the placementProfile value. - */ - PlacementProfile placementProfile(); - - /** - * Gets the osProfile property: OS properties. - * - * @return the osProfile value. - */ - OsProfile osProfile(); - - /** - * Gets the hardwareProfile property: Hardware properties. - * - * @return the hardwareProfile value. - */ - HardwareProfile hardwareProfile(); - - /** - * Gets the networkProfile property: Network properties. - * - * @return the networkProfile value. - */ - NetworkProfile networkProfile(); - - /** - * Gets the storageProfile property: Storage properties. - * - * @return the storageProfile value. - */ - StorageProfile storageProfile(); - - /** - * Gets the guestAgentProfile property: Guest agent status properties. - * - * @return the guestAgentProfile value. - */ - GuestAgentProfile guestAgentProfile(); - - /** - * Gets the securityProfile property: Gets the security profile. - * - * @return the securityProfile value. - */ - SecurityProfile securityProfile(); - - /** - * Gets the moRefId property: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. - * - * @return the moRefId value. - */ - String moRefId(); - - /** - * Gets the inventoryItemId property: Gets or sets the inventory Item ID for the virtual machine. - * - * @return the inventoryItemId value. - */ - String inventoryItemId(); - - /** - * Gets the moName property: Gets or sets the vCenter Managed Object name for the virtual machine. - * - * @return the moName value. - */ - String moName(); - - /** - * Gets the folderPath property: Gets or sets the folder path of the vm. - * - * @return the folderPath value. - */ - String folderPath(); - - /** - * Gets the instanceUuid property: Gets or sets the instance uuid of the vm. - * - * @return the instanceUuid value. - */ - String instanceUuid(); - - /** - * Gets the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm. - * - * @return the smbiosUuid value. - */ - String smbiosUuid(); - - /** - * Gets the firmwareType property: Firmware type. - * - * @return the firmwareType value. - */ - FirmwareType firmwareType(); - - /** - * Gets the powerState property: Gets the power state of the virtual machine. - * - * @return the powerState value. - */ - String powerState(); - - /** - * Gets the customResourceName property: Gets the name of the corresponding resource in Kubernetes. - * - * @return the customResourceName value. - */ - String customResourceName(); - - /** - * Gets the uuid property: Gets or sets a unique identifier for this resource. - * - * @return the uuid value. - */ - String uuid(); - - /** - * Gets the statuses property: The resource status information. - * - * @return the statuses value. - */ - List statuses(); - - /** - * Gets the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * Gets the vmId property: Gets or sets a unique identifier for the vm resource. - * - * @return the vmId value. - */ - String vmId(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInner object. - * - * @return the inner object. - */ - VirtualMachineInner innerModel(); - - /** The entirety of the VirtualMachine definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The VirtualMachine definition stages. */ - interface DefinitionStages { - /** The first stage of the VirtualMachine definition. */ - interface Blank extends WithLocation { - } - /** The stage of the VirtualMachine 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 VirtualMachine definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The Resource Group Name. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the VirtualMachine 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.WithKind, - DefinitionStages.WithIdentity, - DefinitionStages.WithResourcePoolId, - DefinitionStages.WithTemplateId, - DefinitionStages.WithVCenterId, - DefinitionStages.WithPlacementProfile, - DefinitionStages.WithOsProfile, - DefinitionStages.WithHardwareProfile, - DefinitionStages.WithNetworkProfile, - DefinitionStages.WithStorageProfile, - DefinitionStages.WithGuestAgentProfile, - DefinitionStages.WithSecurityProfile, - DefinitionStages.WithMoRefId, - DefinitionStages.WithInventoryItemId, - DefinitionStages.WithSmbiosUuid, - DefinitionStages.WithFirmwareType { - /** - * Executes the create request. - * - * @return the created resource. - */ - VirtualMachine create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - VirtualMachine create(Context context); - } - /** The stage of the VirtualMachine 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 VirtualMachine definition allowing to specify extendedLocation. */ - interface WithExtendedLocation { - /** - * Specifies the extendedLocation property: Gets or sets the extended location.. - * - * @param extendedLocation Gets or sets the extended location. - * @return the next definition stage. - */ - WithCreate withExtendedLocation(ExtendedLocation extendedLocation); - } - /** The stage of the VirtualMachine definition allowing to specify kind. */ - interface WithKind { - /** - * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for - * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the - * resource provider must validate and persist this value.. - * - * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider - * must validate and persist this value. - * @return the next definition stage. - */ - WithCreate withKind(String kind); - } - /** The stage of the VirtualMachine definition allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: The identity of the resource.. - * - * @param identity The identity of the resource. - * @return the next definition stage. - */ - WithCreate withIdentity(Identity identity); - } - /** The stage of the VirtualMachine definition allowing to specify resourcePoolId. */ - interface WithResourcePoolId { - /** - * Specifies the resourcePoolId property: Gets or sets the ARM Id of the resourcePool resource on which this - * virtual machine will deploy.. - * - * @param resourcePoolId Gets or sets the ARM Id of the resourcePool resource on which this virtual machine - * will deploy. - * @return the next definition stage. - */ - WithCreate withResourcePoolId(String resourcePoolId); - } - /** The stage of the VirtualMachine definition allowing to specify templateId. */ - interface WithTemplateId { - /** - * Specifies the templateId property: Gets or sets the ARM Id of the template resource to deploy the virtual - * machine.. - * - * @param templateId Gets or sets the ARM Id of the template resource to deploy the virtual machine. - * @return the next definition stage. - */ - WithCreate withTemplateId(String templateId); - } - /** The stage of the VirtualMachine definition allowing to specify vCenterId. */ - interface WithVCenterId { - /** - * Specifies the vCenterId property: Gets or sets the ARM Id of the vCenter resource in which this resource - * pool resides.. - * - * @param vCenterId Gets or sets the ARM Id of the vCenter resource in which this resource pool resides. - * @return the next definition stage. - */ - WithCreate withVCenterId(String vCenterId); - } - /** The stage of the VirtualMachine definition allowing to specify placementProfile. */ - interface WithPlacementProfile { - /** - * Specifies the placementProfile property: Placement properties.. - * - * @param placementProfile Placement properties. - * @return the next definition stage. - */ - WithCreate withPlacementProfile(PlacementProfile placementProfile); - } - /** The stage of the VirtualMachine definition allowing to specify osProfile. */ - interface WithOsProfile { - /** - * Specifies the osProfile property: OS properties.. - * - * @param osProfile OS properties. - * @return the next definition stage. - */ - WithCreate withOsProfile(OsProfile osProfile); - } - /** The stage of the VirtualMachine definition allowing to specify hardwareProfile. */ - interface WithHardwareProfile { - /** - * Specifies the hardwareProfile property: Hardware properties.. - * - * @param hardwareProfile Hardware properties. - * @return the next definition stage. - */ - WithCreate withHardwareProfile(HardwareProfile hardwareProfile); - } - /** The stage of the VirtualMachine definition allowing to specify networkProfile. */ - interface WithNetworkProfile { - /** - * Specifies the networkProfile property: Network properties.. - * - * @param networkProfile Network properties. - * @return the next definition stage. - */ - WithCreate withNetworkProfile(NetworkProfile networkProfile); - } - /** The stage of the VirtualMachine definition allowing to specify storageProfile. */ - interface WithStorageProfile { - /** - * Specifies the storageProfile property: Storage properties.. - * - * @param storageProfile Storage properties. - * @return the next definition stage. - */ - WithCreate withStorageProfile(StorageProfile storageProfile); - } - /** The stage of the VirtualMachine definition allowing to specify guestAgentProfile. */ - interface WithGuestAgentProfile { - /** - * Specifies the guestAgentProfile property: Guest agent status properties.. - * - * @param guestAgentProfile Guest agent status properties. - * @return the next definition stage. - */ - WithCreate withGuestAgentProfile(GuestAgentProfile guestAgentProfile); - } - /** The stage of the VirtualMachine definition allowing to specify securityProfile. */ - interface WithSecurityProfile { - /** - * Specifies the securityProfile property: Gets the security profile.. - * - * @param securityProfile Gets the security profile. - * @return the next definition stage. - */ - WithCreate withSecurityProfile(SecurityProfile securityProfile); - } - /** The stage of the VirtualMachine definition allowing to specify moRefId. */ - interface WithMoRefId { - /** - * Specifies the moRefId property: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the - * virtual machine.. - * - * @param moRefId Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual machine. - * @return the next definition stage. - */ - WithCreate withMoRefId(String moRefId); - } - /** The stage of the VirtualMachine definition allowing to specify inventoryItemId. */ - interface WithInventoryItemId { - /** - * Specifies the inventoryItemId property: Gets or sets the inventory Item ID for the virtual machine.. - * - * @param inventoryItemId Gets or sets the inventory Item ID for the virtual machine. - * @return the next definition stage. - */ - WithCreate withInventoryItemId(String inventoryItemId); - } - /** The stage of the VirtualMachine definition allowing to specify smbiosUuid. */ - interface WithSmbiosUuid { - /** - * Specifies the smbiosUuid property: Gets or sets the SMBIOS UUID of the vm.. - * - * @param smbiosUuid Gets or sets the SMBIOS UUID of the vm. - * @return the next definition stage. - */ - WithCreate withSmbiosUuid(String smbiosUuid); - } - /** The stage of the VirtualMachine definition allowing to specify firmwareType. */ - interface WithFirmwareType { - /** - * Specifies the firmwareType property: Firmware type. - * - * @param firmwareType Firmware type. - * @return the next definition stage. - */ - WithCreate withFirmwareType(FirmwareType firmwareType); - } - } - /** - * Begins update for the VirtualMachine resource. - * - * @return the stage of resource update. - */ - VirtualMachine.Update update(); - - /** The template for VirtualMachine update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithIdentity, - UpdateStages.WithHardwareProfile, - UpdateStages.WithOsProfile, - UpdateStages.WithStorageProfile, - UpdateStages.WithNetworkProfile { - /** - * Executes the update request. - * - * @return the updated resource. - */ - VirtualMachine apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - VirtualMachine apply(Context context); - } - /** The VirtualMachine update stages. */ - interface UpdateStages { - /** The stage of the VirtualMachine update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Gets or sets the Resource tags.. - * - * @param tags Gets or sets the Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - /** The stage of the VirtualMachine update allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: The identity of the resource.. - * - * @param identity The identity of the resource. - * @return the next definition stage. - */ - Update withIdentity(Identity identity); - } - /** The stage of the VirtualMachine update allowing to specify hardwareProfile. */ - interface WithHardwareProfile { - /** - * Specifies the hardwareProfile property: Defines the resource properties.. - * - * @param hardwareProfile Defines the resource properties. - * @return the next definition stage. - */ - Update withHardwareProfile(HardwareProfile hardwareProfile); - } - /** The stage of the VirtualMachine update allowing to specify osProfile. */ - interface WithOsProfile { - /** - * Specifies the osProfile property: OS properties.. - * - * @param osProfile OS properties. - * @return the next definition stage. - */ - Update withOsProfile(OsProfileUpdate osProfile); - } - /** The stage of the VirtualMachine update allowing to specify storageProfile. */ - interface WithStorageProfile { - /** - * Specifies the storageProfile property: Defines the resource update properties.. - * - * @param storageProfile Defines the resource update properties. - * @return the next definition stage. - */ - Update withStorageProfile(StorageProfileUpdate storageProfile); - } - /** The stage of the VirtualMachine update allowing to specify networkProfile. */ - interface WithNetworkProfile { - /** - * Specifies the networkProfile property: Defines the update resource properties.. - * - * @param networkProfile Defines the update resource properties. - * @return the next definition stage. - */ - Update withNetworkProfile(NetworkProfileUpdate networkProfile); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - VirtualMachine refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - VirtualMachine refresh(Context context); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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(StopVirtualMachineOptions body); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @throws com.azure.core.management.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(); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param body Virtualmachine stop action payload. - * @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(StopVirtualMachineOptions body, Context context); - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @throws com.azure.core.management.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(); - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(Context context); - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @throws com.azure.core.management.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(); - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restart(Context context); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineAssessPatchesResult.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineAssessPatchesResult.java deleted file mode 100644 index 3179a1b61810..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineAssessPatchesResult.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.models; - -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineAssessPatchesResultInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of VirtualMachineAssessPatchesResult. */ -public interface VirtualMachineAssessPatchesResult { - /** - * Gets the status property: The overall success or failure status of the operation. It remains "InProgress" until - * the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or - * "CompletedWithWarnings.". - * - * @return the status value. - */ - PatchOperationStatus status(); - - /** - * Gets the assessmentActivityId property: The activity ID of the operation that produced this result. - * - * @return the assessmentActivityId value. - */ - String assessmentActivityId(); - - /** - * Gets the rebootPending property: The overall reboot status of the VM. It will be true when partially installed - * patches require a reboot to complete installation but the reboot has not yet occurred. - * - * @return the rebootPending value. - */ - Boolean rebootPending(); - - /** - * Gets the availablePatchCountByClassification property: Summarization of patches available for installation on the - * machine by classification. - * - * @return the availablePatchCountByClassification value. - */ - AvailablePatchCountByClassification availablePatchCountByClassification(); - - /** - * Gets the startDateTime property: The UTC timestamp when the operation began. - * - * @return the startDateTime value. - */ - OffsetDateTime startDateTime(); - - /** - * Gets the lastModifiedDateTime property: The UTC timestamp when the operation finished. - * - * @return the lastModifiedDateTime value. - */ - OffsetDateTime lastModifiedDateTime(); - - /** - * Gets the startedBy property: Indicates if operation was triggered by user or by platform. - * - * @return the startedBy value. - */ - PatchOperationStartedBy startedBy(); - - /** - * Gets the patchServiceUsed property: Specifies the patch service used for the operation. - * - * @return the patchServiceUsed value. - */ - PatchServiceUsed patchServiceUsed(); - - /** - * Gets the osType property: The operating system type of the machine. - * - * @return the osType value. - */ - OsTypeUM osType(); - - /** - * Gets the errorDetails property: Error details. - * - *

The errors that were encountered during execution of the operation. The details array contains the list of - * them. - * - * @return the errorDetails value. - */ - ErrorDetail errorDetails(); - - /** - * Gets the inner com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineAssessPatchesResultInner - * object. - * - * @return the inner object. - */ - VirtualMachineAssessPatchesResultInner innerModel(); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstallPatchesParameters.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstallPatchesParameters.java deleted file mode 100644 index d100d8ec040a..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstallPatchesParameters.java +++ /dev/null @@ -1,148 +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.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Input for InstallPatches as directly received by the API. */ -@Fluent -public final class VirtualMachineInstallPatchesParameters { - /* - * Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration - * string such as PT4H (4 hours) - */ - @JsonProperty(value = "maximumDuration", required = true) - private String maximumDuration; - - /* - * Defines when it is acceptable to reboot a VM during a software update operation. - */ - @JsonProperty(value = "rebootSetting", required = true) - private VMGuestPatchRebootSetting rebootSetting; - - /* - * Input for InstallPatches on a Windows VM, as directly received by the API - */ - @JsonProperty(value = "windowsParameters") - private WindowsParameters windowsParameters; - - /* - * Input for InstallPatches on a Linux VM, as directly received by the API - */ - @JsonProperty(value = "linuxParameters") - private LinuxParameters linuxParameters; - - /** - * Get the maximumDuration property: Specifies the maximum amount of time that the operation will run. It must be an - * ISO 8601-compliant duration string such as PT4H (4 hours). - * - * @return the maximumDuration value. - */ - public String maximumDuration() { - return this.maximumDuration; - } - - /** - * Set the maximumDuration property: Specifies the maximum amount of time that the operation will run. It must be an - * ISO 8601-compliant duration string such as PT4H (4 hours). - * - * @param maximumDuration the maximumDuration value to set. - * @return the VirtualMachineInstallPatchesParameters object itself. - */ - public VirtualMachineInstallPatchesParameters withMaximumDuration(String maximumDuration) { - this.maximumDuration = maximumDuration; - return this; - } - - /** - * Get the rebootSetting property: Defines when it is acceptable to reboot a VM during a software update operation. - * - * @return the rebootSetting value. - */ - public VMGuestPatchRebootSetting rebootSetting() { - return this.rebootSetting; - } - - /** - * Set the rebootSetting property: Defines when it is acceptable to reboot a VM during a software update operation. - * - * @param rebootSetting the rebootSetting value to set. - * @return the VirtualMachineInstallPatchesParameters object itself. - */ - public VirtualMachineInstallPatchesParameters withRebootSetting(VMGuestPatchRebootSetting rebootSetting) { - this.rebootSetting = rebootSetting; - return this; - } - - /** - * Get the windowsParameters property: Input for InstallPatches on a Windows VM, as directly received by the API. - * - * @return the windowsParameters value. - */ - public WindowsParameters windowsParameters() { - return this.windowsParameters; - } - - /** - * Set the windowsParameters property: Input for InstallPatches on a Windows VM, as directly received by the API. - * - * @param windowsParameters the windowsParameters value to set. - * @return the VirtualMachineInstallPatchesParameters object itself. - */ - public VirtualMachineInstallPatchesParameters withWindowsParameters(WindowsParameters windowsParameters) { - this.windowsParameters = windowsParameters; - return this; - } - - /** - * Get the linuxParameters property: Input for InstallPatches on a Linux VM, as directly received by the API. - * - * @return the linuxParameters value. - */ - public LinuxParameters linuxParameters() { - return this.linuxParameters; - } - - /** - * Set the linuxParameters property: Input for InstallPatches on a Linux VM, as directly received by the API. - * - * @param linuxParameters the linuxParameters value to set. - * @return the VirtualMachineInstallPatchesParameters object itself. - */ - public VirtualMachineInstallPatchesParameters withLinuxParameters(LinuxParameters linuxParameters) { - this.linuxParameters = linuxParameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (maximumDuration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property maximumDuration in model VirtualMachineInstallPatchesParameters")); - } - if (rebootSetting() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property rebootSetting in model VirtualMachineInstallPatchesParameters")); - } - if (windowsParameters() != null) { - windowsParameters().validate(); - } - if (linuxParameters() != null) { - linuxParameters().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstallPatchesParameters.class); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstallPatchesResult.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstallPatchesResult.java deleted file mode 100644 index cde48908dd29..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstallPatchesResult.java +++ /dev/null @@ -1,134 +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.connectedvmware.models; - -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstallPatchesResultInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of VirtualMachineInstallPatchesResult. */ -public interface VirtualMachineInstallPatchesResult { - /** - * Gets the status property: The overall success or failure status of the operation. It remains "InProgress" until - * the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or - * "CompletedWithWarnings.". - * - * @return the status value. - */ - PatchOperationStatus status(); - - /** - * Gets the installationActivityId property: The activity ID of the operation that produced this result. - * - * @return the installationActivityId value. - */ - String installationActivityId(); - - /** - * Gets the rebootStatus property: The reboot state of the VM following completion of the operation. - * - * @return the rebootStatus value. - */ - VMGuestPatchRebootStatus rebootStatus(); - - /** - * Gets the maintenanceWindowExceeded property: Whether the operation ran out of time before it completed all its - * intended actions. - * - * @return the maintenanceWindowExceeded value. - */ - Boolean maintenanceWindowExceeded(); - - /** - * Gets the excludedPatchCount property: The number of patches that were not installed due to the user blocking - * their installation. - * - * @return the excludedPatchCount value. - */ - Integer excludedPatchCount(); - - /** - * Gets the notSelectedPatchCount property: The number of patches that were detected as available for install, but - * did not meet the operation's criteria. - * - * @return the notSelectedPatchCount value. - */ - Integer notSelectedPatchCount(); - - /** - * Gets the pendingPatchCount property: The number of patches that were identified as meeting the installation - * criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. - * - * @return the pendingPatchCount value. - */ - Integer pendingPatchCount(); - - /** - * Gets the installedPatchCount property: The number of patches successfully installed. - * - * @return the installedPatchCount value. - */ - Integer installedPatchCount(); - - /** - * Gets the failedPatchCount property: The number of patches that could not be installed due to some issue. See - * errors for details. - * - * @return the failedPatchCount value. - */ - Integer failedPatchCount(); - - /** - * Gets the startDateTime property: The UTC timestamp when the operation began. - * - * @return the startDateTime value. - */ - OffsetDateTime startDateTime(); - - /** - * Gets the lastModifiedDateTime property: The UTC timestamp when the operation finished. - * - * @return the lastModifiedDateTime value. - */ - OffsetDateTime lastModifiedDateTime(); - - /** - * Gets the startedBy property: Indicates if operation was triggered by user or by platform. - * - * @return the startedBy value. - */ - PatchOperationStartedBy startedBy(); - - /** - * Gets the patchServiceUsed property: Specifies the patch service used for the operation. - * - * @return the patchServiceUsed value. - */ - PatchServiceUsed patchServiceUsed(); - - /** - * Gets the osType property: The operating system type of the machine. - * - * @return the osType value. - */ - OsTypeUM osType(); - - /** - * Gets the errorDetails property: Error details. - * - *

The errors that were encountered during execution of the operation. The details array contains the list of - * them. - * - * @return the errorDetails value. - */ - ErrorDetail errorDetails(); - - /** - * Gets the inner com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstallPatchesResultInner - * object. - * - * @return the inner object. - */ - VirtualMachineInstallPatchesResultInner innerModel(); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstance.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstance.java new file mode 100644 index 000000000000..2dc0a458f4dc --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstance.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceInner; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineInstance. */ +public interface VirtualMachineInstance { + /** + * 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 extendedLocation property: Gets or sets the extended location. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the placementProfile property: Placement properties. + * + * @return the placementProfile value. + */ + PlacementProfile placementProfile(); + + /** + * Gets the osProfile property: OS properties. + * + * @return the osProfile value. + */ + OsProfileForVMInstance osProfile(); + + /** + * Gets the hardwareProfile property: Hardware properties. + * + * @return the hardwareProfile value. + */ + HardwareProfile hardwareProfile(); + + /** + * Gets the networkProfile property: Network properties. + * + * @return the networkProfile value. + */ + NetworkProfile networkProfile(); + + /** + * Gets the storageProfile property: Storage properties. + * + * @return the storageProfile value. + */ + StorageProfile storageProfile(); + + /** + * Gets the securityProfile property: Gets the security profile. + * + * @return the securityProfile value. + */ + SecurityProfile securityProfile(); + + /** + * Gets the infrastructureProfile property: Gets the infrastructure profile. + * + * @return the infrastructureProfile value. + */ + InfrastructureProfile infrastructureProfile(); + + /** + * Gets the powerState property: Gets the power state of the virtual machine. + * + * @return the powerState value. + */ + String powerState(); + + /** + * Gets the statuses property: The resource status information. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the provisioningState property: Gets the provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceUid property: Gets or sets a unique identifier for the vm resource. + * + * @return the resourceUid value. + */ + String resourceUid(); + + /** + * Gets the inner com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceInner object. + * + * @return the inner object. + */ + VirtualMachineInstanceInner innerModel(); +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstanceUpdate.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstanceUpdate.java new file mode 100644 index 000000000000..2e1a43d0f76a --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstanceUpdate.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the virtualMachineInstanceUpdate. */ +@Fluent +public final class VirtualMachineInstanceUpdate { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private VirtualMachineInstanceUpdateProperties innerProperties; + + /** Creates an instance of VirtualMachineInstanceUpdate class. */ + public VirtualMachineInstanceUpdate() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private VirtualMachineInstanceUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); + } + + /** + * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineInstanceUpdate object itself. + */ + public VirtualMachineInstanceUpdate withHardwareProfile(HardwareProfile hardwareProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceUpdateProperties(); + } + this.innerProperties().withHardwareProfile(hardwareProfile); + return this; + } + + /** + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + public StorageProfileUpdate storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); + } + + /** + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInstanceUpdate object itself. + */ + public VirtualMachineInstanceUpdate withStorageProfile(StorageProfileUpdate storageProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceUpdateProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + public NetworkProfileUpdate networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + + /** + * Set the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineInstanceUpdate object itself. + */ + public VirtualMachineInstanceUpdate withNetworkProfile(NetworkProfileUpdate networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineInstanceUpdateProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); + 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/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstances.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstances.java new file mode 100644 index 000000000000..15e691a8bfca --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstances.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceInner; + +/** Resource collection API of VirtualMachineInstances. */ +public interface VirtualMachineInstances { + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + VirtualMachineInstance createOrUpdate(String resourceUri); + + /** + * Implements virtual machine PUT method. + * + *

The operation to create or update a virtual machine instance. Please note some properties can be set only + * during virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Request payload. + * @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 define the virtualMachineInstance. + */ + VirtualMachineInstance createOrUpdate(String resourceUri, VirtualMachineInstanceInner body, Context context); + + /** + * Gets a virtual machine. + * + *

Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 define the virtualMachineInstance along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets a virtual machine. + * + *

Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + VirtualMachineInstance get(String resourceUri); + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + VirtualMachineInstance update(String resourceUri); + + /** + * Updates a virtual machine. + * + *

The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Resource properties to update. + * @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 define the virtualMachineInstance. + */ + VirtualMachineInstance update(String resourceUri, VirtualMachineInstanceUpdate body, Context context); + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri); + + /** + * Deletes an virtual machine. + * + *

The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param deleteFromHost Whether to delete the VM from the vCenter. + * @param force Whether force delete was specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri, Boolean deleteFromHost, Boolean force, Context context); + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 VirtualMachineInstances as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * Implements List virtual machine instances. + * + *

Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 VirtualMachineInstances as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceUri); + + /** + * Implements the operation to stop a virtual machine. + * + *

The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @param body Virtualmachine stop action payload. + * @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 resourceUri, StopVirtualMachineOptions body, Context context); + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceUri); + + /** + * Implements the operation to start a virtual machine. + * + *

The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri, Context context); + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceUri); + + /** + * Implements the operation to restart a virtual machine. + * + *

The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 resourceUri, Context context); +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachinesList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstancesList.java similarity index 69% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachinesList.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstancesList.java index f4a2c62cab09..23d655b22f30 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachinesList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInstancesList.java @@ -6,13 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of VirtualMachines. */ +/** List of VirtualMachineInstances. */ @Fluent -public final class VirtualMachinesList { +public final class VirtualMachineInstancesList { /* * Url to follow for getting next page of VirtualMachines. */ @@ -23,7 +23,11 @@ public final class VirtualMachinesList { * Array of VirtualMachines */ @JsonProperty(value = "value", required = true) - private List value; + private List value; + + /** Creates an instance of VirtualMachineInstancesList class. */ + public VirtualMachineInstancesList() { + } /** * Get the nextLink property: Url to follow for getting next page of VirtualMachines. @@ -38,9 +42,9 @@ public String nextLink() { * Set the nextLink property: Url to follow for getting next page of VirtualMachines. * * @param nextLink the nextLink value to set. - * @return the VirtualMachinesList object itself. + * @return the VirtualMachineInstancesList object itself. */ - public VirtualMachinesList withNextLink(String nextLink) { + public VirtualMachineInstancesList withNextLink(String nextLink) { this.nextLink = nextLink; return this; } @@ -50,7 +54,7 @@ public VirtualMachinesList withNextLink(String nextLink) { * * @return the value value. */ - public List value() { + public List value() { return this.value; } @@ -58,9 +62,9 @@ public List value() { * Set the value property: Array of VirtualMachines. * * @param value the value value to set. - * @return the VirtualMachinesList object itself. + * @return the VirtualMachineInstancesList object itself. */ - public VirtualMachinesList withValue(List value) { + public VirtualMachineInstancesList withValue(List value) { this.value = value; return this; } @@ -74,11 +78,12 @@ public void validate() { if (value() == null) { throw LOGGER .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model VirtualMachinesList")); + new IllegalArgumentException( + "Missing required property value in model VirtualMachineInstancesList")); } else { value().forEach(e -> e.validate()); } } - private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinesList.class); + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstancesList.class); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInventoryItem.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInventoryItem.java index 951cbadedfb6..d49c021d776f 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInventoryItem.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineInventoryItem.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.connectedvmware.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -52,6 +51,12 @@ public final class VirtualMachineInventoryItem extends InventoryItemProperties { @JsonProperty(value = "resourcePool") private InventoryItemDetails resourcePool; + /* + * Cluster inventory resource details. + */ + @JsonProperty(value = "cluster") + private InventoryItemDetails cluster; + /* * Gets or sets the instance uuid of the vm. */ @@ -88,6 +93,10 @@ public final class VirtualMachineInventoryItem extends InventoryItemProperties { @JsonProperty(value = "toolsVersion", access = JsonProperty.Access.WRITE_ONLY) private String toolsVersion; + /** Creates an instance of VirtualMachineInventoryItem class. */ + public VirtualMachineInventoryItem() { + } + /** * Get the osType property: Gets or sets the type of the os. * @@ -208,6 +217,26 @@ public VirtualMachineInventoryItem withResourcePool(InventoryItemDetails resourc return this; } + /** + * Get the cluster property: Cluster inventory resource details. + * + * @return the cluster value. + */ + public InventoryItemDetails cluster() { + return this.cluster; + } + + /** + * Set the cluster property: Cluster inventory resource details. + * + * @param cluster the cluster value to set. + * @return the VirtualMachineInventoryItem object itself. + */ + public VirtualMachineInventoryItem withCluster(InventoryItemDetails cluster) { + this.cluster = cluster; + return this; + } + /** * Get the instanceUuid property: Gets or sets the instance uuid of the vm. * @@ -321,5 +350,8 @@ public void validate() { if (resourcePool() != null) { resourcePool().validate(); } + if (cluster() != null) { + cluster().validate(); + } } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplate.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplate.java index abbd90445f85..c32098514958 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplate.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplate.java @@ -201,11 +201,11 @@ public interface VirtualMachineTemplate { List statuses(); /** - * Gets the provisioningState property: Gets or sets the provisioning state. + * Gets the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - String provisioningState(); + ProvisioningState provisioningState(); /** * Gets the region of the resource. @@ -242,11 +242,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The VirtualMachineTemplate definition stages. */ interface DefinitionStages { /** The first stage of the VirtualMachineTemplate definition. */ interface Blank extends WithLocation { } + /** The stage of the VirtualMachineTemplate definition allowing to specify location. */ interface WithLocation { /** @@ -265,6 +267,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the VirtualMachineTemplate definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -275,6 +278,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the VirtualMachineTemplate 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. @@ -301,6 +305,7 @@ interface WithCreate */ VirtualMachineTemplate create(Context context); } + /** The stage of the VirtualMachineTemplate definition allowing to specify tags. */ interface WithTags { /** @@ -311,6 +316,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the VirtualMachineTemplate definition allowing to specify extendedLocation. */ interface WithExtendedLocation { /** @@ -321,6 +327,7 @@ interface WithExtendedLocation { */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** The stage of the VirtualMachineTemplate definition allowing to specify kind. */ interface WithKind { /** @@ -335,6 +342,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the VirtualMachineTemplate definition allowing to specify vCenterId. */ interface WithVCenterId { /** @@ -346,6 +354,7 @@ interface WithVCenterId { */ WithCreate withVCenterId(String vCenterId); } + /** The stage of the VirtualMachineTemplate definition allowing to specify moRefId. */ interface WithMoRefId { /** @@ -358,6 +367,7 @@ interface WithMoRefId { */ WithCreate withMoRefId(String moRefId); } + /** The stage of the VirtualMachineTemplate definition allowing to specify inventoryItemId. */ interface WithInventoryItemId { /** @@ -370,6 +380,7 @@ interface WithInventoryItemId { WithCreate withInventoryItemId(String inventoryItemId); } } + /** * Begins update for the VirtualMachineTemplate resource. * @@ -394,6 +405,7 @@ interface Update extends UpdateStages.WithTags { */ VirtualMachineTemplate apply(Context context); } + /** The VirtualMachineTemplate update stages. */ interface UpdateStages { /** The stage of the VirtualMachineTemplate update allowing to specify tags. */ @@ -407,6 +419,7 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplateInventoryItem.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplateInventoryItem.java index f60534bb896c..893539ffea9a 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplateInventoryItem.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplateInventoryItem.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.connectedvmware.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -46,12 +45,28 @@ public final class VirtualMachineTemplateInventoryItem extends InventoryItemProp @JsonProperty(value = "osName") private String osName; + /* + * Gets or sets the current version status of VMware Tools installed in the guest operating system. + */ + @JsonProperty(value = "toolsVersionStatus", access = JsonProperty.Access.WRITE_ONLY) + private String toolsVersionStatus; + + /* + * Gets or sets the current version of VMware Tools. + */ + @JsonProperty(value = "toolsVersion", access = JsonProperty.Access.WRITE_ONLY) + private String toolsVersion; + /* * Gets or sets the folder path of the template. */ @JsonProperty(value = "folderPath") private String folderPath; + /** Creates an instance of VirtualMachineTemplateInventoryItem class. */ + public VirtualMachineTemplateInventoryItem() { + } + /** * Get the memorySizeMB property: Gets or sets memory size in MBs for the template. * @@ -154,6 +169,25 @@ public VirtualMachineTemplateInventoryItem withOsName(String osName) { return this; } + /** + * Get the toolsVersionStatus property: Gets or sets the current version status of VMware Tools installed in the + * guest operating system. + * + * @return the toolsVersionStatus value. + */ + public String toolsVersionStatus() { + return this.toolsVersionStatus; + } + + /** + * Get the toolsVersion property: Gets or sets the current version of VMware Tools. + * + * @return the toolsVersion value. + */ + public String toolsVersion() { + return this.toolsVersion; + } + /** * Get the folderPath property: Gets or sets the folder path of the template. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplates.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplates.java index b67de7ae61a5..ba5b233a75db 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplates.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplates.java @@ -10,20 +10,6 @@ /** Resource collection API of VirtualMachineTemplates. */ public interface VirtualMachineTemplates { - /** - * Gets a virtual machine template. - * - *

Implements virtual machine template GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachineTemplate. - */ - VirtualMachineTemplate getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName); - /** * Gets a virtual machine template. * @@ -41,18 +27,18 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String virtualMachineTemplateName, Context context); /** - * Deletes an virtual machine template. + * Gets a virtual machine template. * - *

Implements virtual machine template DELETE method. + *

Implements virtual machine template GET method. * * @param resourceGroupName The Resource Group Name. * @param virtualMachineTemplateName Name of the virtual machine template resource. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineTemplate. */ - void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force); + VirtualMachineTemplate getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName); /** * Deletes an virtual machine template. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplatesList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplatesList.java index 5fbe692ff0b4..a3151c8362a2 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplatesList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineTemplatesList.java @@ -25,6 +25,10 @@ public final class VirtualMachineTemplatesList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of VirtualMachineTemplatesList class. */ + public VirtualMachineTemplatesList() { + } + /** * Get the nextLink property: Url to follow for getting next page of VirtualMachineTemplates. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineUpdate.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineUpdate.java deleted file mode 100644 index 41606e5ce120..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachineUpdate.java +++ /dev/null @@ -1,189 +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.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineUpdateProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Defines the virtualMachineUpdate. */ -@Fluent -public final class VirtualMachineUpdate { - /* - * Resource properties. - */ - @JsonProperty(value = "properties") - private VirtualMachineUpdateProperties innerProperties; - - /* - * Gets or sets the Resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity") - private Identity identity; - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private VirtualMachineUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Gets or sets the Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Gets or sets the Resource tags. - * - * @param tags the tags value to set. - * @return the VirtualMachineUpdate object itself. - */ - public VirtualMachineUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the identity property: The identity of the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the resource. - * - * @param identity the identity value to set. - * @return the VirtualMachineUpdate object itself. - */ - public VirtualMachineUpdate withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the hardwareProfile property: Defines the resource properties. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); - } - - /** - * Set the hardwareProfile property: Defines the resource properties. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineUpdate object itself. - */ - public VirtualMachineUpdate withHardwareProfile(HardwareProfile hardwareProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineUpdateProperties(); - } - this.innerProperties().withHardwareProfile(hardwareProfile); - return this; - } - - /** - * Get the osProfile property: OS properties. - * - * @return the osProfile value. - */ - public OsProfileUpdate osProfile() { - return this.innerProperties() == null ? null : this.innerProperties().osProfile(); - } - - /** - * Set the osProfile property: OS properties. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineUpdate object itself. - */ - public VirtualMachineUpdate withOsProfile(OsProfileUpdate osProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineUpdateProperties(); - } - this.innerProperties().withOsProfile(osProfile); - return this; - } - - /** - * Get the storageProfile property: Defines the resource update properties. - * - * @return the storageProfile value. - */ - public StorageProfileUpdate storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: Defines the resource update properties. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineUpdate object itself. - */ - public VirtualMachineUpdate withStorageProfile(StorageProfileUpdate storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineUpdateProperties(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the networkProfile property: Defines the update resource properties. - * - * @return the networkProfile value. - */ - public NetworkProfileUpdate networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: Defines the update resource properties. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineUpdate object itself. - */ - public VirtualMachineUpdate withNetworkProfile(NetworkProfileUpdate networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineUpdateProperties(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachines.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachines.java deleted file mode 100644 index c5ed00bcc2e4..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualMachines.java +++ /dev/null @@ -1,352 +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.connectedvmware.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 VirtualMachines. */ -public interface VirtualMachines { - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name); - - /** - * The operation to assess patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the properties of an AssessPatches result. - */ - VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name, Context context); - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result summary of an installation operation. - */ - VirtualMachineInstallPatchesResult installPatches( - String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput); - - /** - * The operation to install patches on a vSphere VMware machine identity in Azure. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the vSphere VMware machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API. - * @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 result summary of an installation operation. - */ - VirtualMachineInstallPatchesResult installPatches( - String resourceGroupName, - String name, - VirtualMachineInstallPatchesParameters installPatchesInput, - Context context); - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine. - */ - VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName); - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualMachine along with {@link Response}. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineName, Context context); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String virtualMachineName); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain, Context context); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 virtualMachineName, StopVirtualMachineOptions body); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(String resourceGroupName, String virtualMachineName); - - /** - * Implements the operation to stop a virtual machine. - * - *

Stop virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param body Virtualmachine stop action payload. - * @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 virtualMachineName, StopVirtualMachineOptions body, Context context); - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(String resourceGroupName, String virtualMachineName); - - /** - * Implements the operation to start a virtual machine. - * - *

Start virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restart(String resourceGroupName, String virtualMachineName); - - /** - * Implements the operation to restart a virtual machine. - * - *

Restart virtual machine. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualMachineName Name of the virtual machine resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restart(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Implements GET virtualMachines in a subscription. - * - *

List of virtualMachines in a 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 VirtualMachines as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Implements GET virtualMachines in a resource group. - * - *

List of virtualMachines in a resource group. - * - * @param resourceGroupName The Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @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 define the virtualMachine along with {@link Response}. - */ - VirtualMachine getById(String id); - - /** - * Gets a virtual machine. - * - *

Implements virtual machine GET method. - * - * @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 define the virtualMachine along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes an virtual machine. - * - *

Implements virtual machine DELETE method. - * - * @param id the resource ID. - * @param force Whether force delete was specified. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @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 deleteByIdWithResponse(String id, Boolean force, Boolean retain, Context context); - - /** - * Begins definition for a new VirtualMachine resource. - * - * @param name resource name. - * @return the first stage of the new VirtualMachine definition. - */ - VirtualMachine.DefinitionStages.Blank define(String name); -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetwork.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetwork.java index f9ea5e54cc40..c63d1d05ee6c 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetwork.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetwork.java @@ -121,11 +121,11 @@ public interface VirtualNetwork { List statuses(); /** - * Gets the provisioningState property: Gets or sets the provisioning state. + * Gets the provisioningState property: Gets the provisioning state. * * @return the provisioningState value. */ - String provisioningState(); + ProvisioningState provisioningState(); /** * Gets the region of the resource. @@ -162,11 +162,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The VirtualNetwork definition stages. */ interface DefinitionStages { /** The first stage of the VirtualNetwork definition. */ interface Blank extends WithLocation { } + /** The stage of the VirtualNetwork definition allowing to specify location. */ interface WithLocation { /** @@ -185,6 +187,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the VirtualNetwork definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -195,6 +198,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the VirtualNetwork 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. @@ -221,6 +225,7 @@ interface WithCreate */ VirtualNetwork create(Context context); } + /** The stage of the VirtualNetwork definition allowing to specify tags. */ interface WithTags { /** @@ -231,6 +236,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the VirtualNetwork definition allowing to specify extendedLocation. */ interface WithExtendedLocation { /** @@ -241,6 +247,7 @@ interface WithExtendedLocation { */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** The stage of the VirtualNetwork definition allowing to specify kind. */ interface WithKind { /** @@ -255,6 +262,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the VirtualNetwork definition allowing to specify vCenterId. */ interface WithVCenterId { /** @@ -266,6 +274,7 @@ interface WithVCenterId { */ WithCreate withVCenterId(String vCenterId); } + /** The stage of the VirtualNetwork definition allowing to specify moRefId. */ interface WithMoRefId { /** @@ -277,6 +286,7 @@ interface WithMoRefId { */ WithCreate withMoRefId(String moRefId); } + /** The stage of the VirtualNetwork definition allowing to specify inventoryItemId. */ interface WithInventoryItemId { /** @@ -288,6 +298,7 @@ interface WithInventoryItemId { WithCreate withInventoryItemId(String inventoryItemId); } } + /** * Begins update for the VirtualNetwork resource. * @@ -312,6 +323,7 @@ interface Update extends UpdateStages.WithTags { */ VirtualNetwork apply(Context context); } + /** The VirtualNetwork update stages. */ interface UpdateStages { /** The stage of the VirtualNetwork update allowing to specify tags. */ @@ -325,6 +337,7 @@ interface WithTags { Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworkInventoryItem.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworkInventoryItem.java index d4229d242851..9ee52b35049a 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworkInventoryItem.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworkInventoryItem.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.connectedvmware.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.connectedvmware.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -14,6 +13,10 @@ @JsonTypeName("VirtualNetwork") @Fluent public final class VirtualNetworkInventoryItem extends InventoryItemProperties { + /** Creates an instance of VirtualNetworkInventoryItem class. */ + public VirtualNetworkInventoryItem() { + } + /** {@inheritDoc} */ @Override public VirtualNetworkInventoryItem withManagedResourceId(String managedResourceId) { diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworks.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworks.java index 0e17596edf5c..dafe6f035cbb 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworks.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworks.java @@ -10,20 +10,6 @@ /** Resource collection API of VirtualNetworks. */ public interface VirtualNetworks { - /** - * Gets a virtual network. - * - *

Implements virtual network GET method. - * - * @param resourceGroupName The Resource Group Name. - * @param virtualNetworkName Name of the virtual network resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define the virtualNetwork. - */ - VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName); - /** * Gets a virtual network. * @@ -41,18 +27,18 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String virtualNetworkName, Context context); /** - * Deletes an virtual network. + * Gets a virtual network. * - *

Implements virtual network DELETE method. + *

Implements virtual network GET method. * * @param resourceGroupName The Resource Group Name. * @param virtualNetworkName Name of the virtual network resource. - * @param force Whether force delete was specified. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualNetwork. */ - void delete(String resourceGroupName, String virtualNetworkName, Boolean force); + VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName); /** * Deletes an virtual network. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworksList.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworksList.java index eed80eaaa6de..37332f28e622 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworksList.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualNetworksList.java @@ -25,6 +25,10 @@ public final class VirtualNetworksList { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of VirtualNetworksList class. */ + public VirtualNetworksList() { + } + /** * Get the nextLink property: Url to follow for getting next page of VirtualNetworks. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualScsiController.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualScsiController.java index 2adf836a99dc..108657d44ea2 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualScsiController.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualScsiController.java @@ -43,6 +43,10 @@ public final class VirtualScsiController { @JsonProperty(value = "sharing") private VirtualScsiSharing sharing; + /** Creates an instance of VirtualScsiController class. */ + public VirtualScsiController() { + } + /** * Get the type property: Gets or sets the controller type. * diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualScsiSharing.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualScsiSharing.java index 5eddf3ec8682..a255533bf62c 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualScsiSharing.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VirtualScsiSharing.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for VirtualScsiSharing. */ +/** Defines the sharing mode for sharing the SCSI bus. */ public final class VirtualScsiSharing extends ExpandableStringEnum { /** Static value noSharing for VirtualScsiSharing. */ public static final VirtualScsiSharing NO_SHARING = fromString("noSharing"); @@ -19,6 +19,15 @@ public final class VirtualScsiSharing extends ExpandableStringEnum value; + private List value; + + /** Creates an instance of VmInstanceHybridIdentityMetadataList class. */ + public VmInstanceHybridIdentityMetadataList() { + } /** * Get the nextLink property: Url to follow for getting next page of HybridIdentityMetadata. @@ -38,9 +42,9 @@ public String nextLink() { * Set the nextLink property: Url to follow for getting next page of HybridIdentityMetadata. * * @param nextLink the nextLink value to set. - * @return the HybridIdentityMetadataList object itself. + * @return the VmInstanceHybridIdentityMetadataList object itself. */ - public HybridIdentityMetadataList withNextLink(String nextLink) { + public VmInstanceHybridIdentityMetadataList withNextLink(String nextLink) { this.nextLink = nextLink; return this; } @@ -50,7 +54,7 @@ public HybridIdentityMetadataList withNextLink(String nextLink) { * * @return the value value. */ - public List value() { + public List value() { return this.value; } @@ -58,9 +62,9 @@ public List value() { * Set the value property: Array of HybridIdentityMetadata. * * @param value the value value to set. - * @return the HybridIdentityMetadataList object itself. + * @return the VmInstanceHybridIdentityMetadataList object itself. */ - public HybridIdentityMetadataList withValue(List value) { + public VmInstanceHybridIdentityMetadataList withValue(List value) { this.value = value; return this; } @@ -75,11 +79,11 @@ public void validate() { throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property value in model HybridIdentityMetadataList")); + "Missing required property value in model VmInstanceHybridIdentityMetadataList")); } else { value().forEach(e -> e.validate()); } } - private static final ClientLogger LOGGER = new ClientLogger(HybridIdentityMetadataList.class); + private static final ClientLogger LOGGER = new ClientLogger(VmInstanceHybridIdentityMetadataList.class); } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VmInstanceHybridIdentityMetadatas.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VmInstanceHybridIdentityMetadatas.java new file mode 100644 index 000000000000..edf264e2c5b1 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/VmInstanceHybridIdentityMetadatas.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.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 VmInstanceHybridIdentityMetadatas. */ +public interface VmInstanceHybridIdentityMetadatas { + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 defines the HybridIdentityMetadata along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Gets HybridIdentityMetadata. + * + *

Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata. + */ + VmInstanceHybridIdentityMetadata get(String resourceUri); + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * Implements GET HybridIdentityMetadata in a vm. + * + *

Returns the list of HybridIdentityMetadata of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the Hybrid Compute machine resource + * to be extended. + * @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 HybridIdentityMetadata as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/WindowsParameters.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/WindowsParameters.java deleted file mode 100644 index 8236bb71aa59..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/main/java/com/azure/resourcemanager/connectedvmware/models/WindowsParameters.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.connectedvmware.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Input for InstallPatches on a Windows VM, as directly received by the API. */ -@Fluent -public final class WindowsParameters { - /* - * The update classifications to select when installing patches for Windows. - */ - @JsonProperty(value = "classificationsToInclude") - private List classificationsToInclude; - - /* - * Kbs to include in the patch operation - */ - @JsonProperty(value = "kbNumbersToInclude") - private List kbNumbersToInclude; - - /* - * Kbs to exclude in the patch operation - */ - @JsonProperty(value = "kbNumbersToExclude") - private List kbNumbersToExclude; - - /* - * Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. - */ - @JsonProperty(value = "excludeKbsRequiringReboot") - private Boolean excludeKbsRequiringReboot; - - /* - * This is used to install patches that were published on or before this given max published date. - */ - @JsonProperty(value = "maxPatchPublishDate") - private OffsetDateTime maxPatchPublishDate; - - /** - * Get the classificationsToInclude property: The update classifications to select when installing patches for - * Windows. - * - * @return the classificationsToInclude value. - */ - public List classificationsToInclude() { - return this.classificationsToInclude; - } - - /** - * Set the classificationsToInclude property: The update classifications to select when installing patches for - * Windows. - * - * @param classificationsToInclude the classificationsToInclude value to set. - * @return the WindowsParameters object itself. - */ - public WindowsParameters withClassificationsToInclude( - List classificationsToInclude) { - this.classificationsToInclude = classificationsToInclude; - return this; - } - - /** - * Get the kbNumbersToInclude property: Kbs to include in the patch operation. - * - * @return the kbNumbersToInclude value. - */ - public List kbNumbersToInclude() { - return this.kbNumbersToInclude; - } - - /** - * Set the kbNumbersToInclude property: Kbs to include in the patch operation. - * - * @param kbNumbersToInclude the kbNumbersToInclude value to set. - * @return the WindowsParameters object itself. - */ - public WindowsParameters withKbNumbersToInclude(List kbNumbersToInclude) { - this.kbNumbersToInclude = kbNumbersToInclude; - return this; - } - - /** - * Get the kbNumbersToExclude property: Kbs to exclude in the patch operation. - * - * @return the kbNumbersToExclude value. - */ - public List kbNumbersToExclude() { - return this.kbNumbersToExclude; - } - - /** - * Set the kbNumbersToExclude property: Kbs to exclude in the patch operation. - * - * @param kbNumbersToExclude the kbNumbersToExclude value to set. - * @return the WindowsParameters object itself. - */ - public WindowsParameters withKbNumbersToExclude(List kbNumbersToExclude) { - this.kbNumbersToExclude = kbNumbersToExclude; - return this; - } - - /** - * Get the excludeKbsRequiringReboot property: Filters out Kbs that don't have an InstallationRebootBehavior of - * 'NeverReboots' when this is set to true. - * - * @return the excludeKbsRequiringReboot value. - */ - public Boolean excludeKbsRequiringReboot() { - return this.excludeKbsRequiringReboot; - } - - /** - * Set the excludeKbsRequiringReboot property: Filters out Kbs that don't have an InstallationRebootBehavior of - * 'NeverReboots' when this is set to true. - * - * @param excludeKbsRequiringReboot the excludeKbsRequiringReboot value to set. - * @return the WindowsParameters object itself. - */ - public WindowsParameters withExcludeKbsRequiringReboot(Boolean excludeKbsRequiringReboot) { - this.excludeKbsRequiringReboot = excludeKbsRequiringReboot; - return this; - } - - /** - * Get the maxPatchPublishDate property: This is used to install patches that were published on or before this given - * max published date. - * - * @return the maxPatchPublishDate value. - */ - public OffsetDateTime maxPatchPublishDate() { - return this.maxPatchPublishDate; - } - - /** - * Set the maxPatchPublishDate property: This is used to install patches that were published on or before this given - * max published date. - * - * @param maxPatchPublishDate the maxPatchPublishDate value to set. - * @return the WindowsParameters object itself. - */ - public WindowsParameters withMaxPatchPublishDate(OffsetDateTime maxPatchPublishDate) { - this.maxPatchPublishDate = maxPatchPublishDate; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersCreateSamples.java index b003187abcd1..2c0e1ce91a90 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersCreateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersCreateSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters Create. */ public final class ClustersCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateCluster.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateCluster.json */ /** * Sample code: CreateCluster. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersDeleteSamples.java index aacfddbed1fe..17b3a1ba9d4c 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Clusters Delete. */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteCluster.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteCluster.json */ /** * Sample code: DeleteCluster. @@ -17,6 +15,6 @@ public final class ClustersDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteCluster(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.clusters().delete("testrg", "HRCluster", null, Context.NONE); + manager.clusters().delete("testrg", "HRCluster", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersGetByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersGetByResourceGroupSamples.java index ffcd42ea1255..7158c568364d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Clusters GetByResourceGroup. */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetCluster.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetCluster.json */ /** * Sample code: GetCluster. @@ -17,6 +15,6 @@ public final class ClustersGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getCluster(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.clusters().getByResourceGroupWithResponse("testrg", "HRCluster", Context.NONE); + manager.clusters().getByResourceGroupWithResponse("testrg", "HRCluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersListByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersListByResourceGroupSamples.java index bc90c36b17b2..9f9b9dd1e463 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Clusters ListByResourceGroup. */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListClustersByResourceGroup.json */ /** * Sample code: ListClustersByResourceGroup. @@ -18,6 +16,6 @@ public final class ClustersListByResourceGroupSamples { */ public static void listClustersByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.clusters().listByResourceGroup("testrg", Context.NONE); + manager.clusters().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersListSamples.java index 969d88ab893b..bf081b46bb96 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersListSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Clusters List. */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListClusters.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListClusters.json */ /** * Sample code: ListClusters. @@ -17,6 +15,6 @@ public final class ClustersListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listClusters(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.clusters().list(Context.NONE); + manager.clusters().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersUpdateSamples.java index c5a6f3e8abac..53c8eae74c89 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersUpdateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ClustersUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.Cluster; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for Clusters Update. */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateCluster.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateCluster.json */ /** * Sample code: UpdateCluster. @@ -21,10 +20,14 @@ public final class ClustersUpdateSamples { */ public static void updateCluster(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { Cluster resource = - manager.clusters().getByResourceGroupWithResponse("testrg", "HRCluster", Context.NONE).getValue(); + manager + .clusters() + .getByResourceGroupWithResponse("testrg", "HRCluster", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresCreateSamples.java index 043bc95f0274..e782a3efc978 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresCreateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresCreateSamples.java @@ -9,7 +9,7 @@ /** Samples for Datastores Create. */ public final class DatastoresCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateDatastore.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateDatastore.json */ /** * Sample code: CreateDatastore. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresDeleteSamples.java index accde183db73..ecd0db70720b 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Datastores Delete. */ public final class DatastoresDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteDatastore.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteDatastore.json */ /** * Sample code: DeleteDatastore. @@ -17,6 +15,6 @@ public final class DatastoresDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteDatastore(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.datastores().delete("testrg", "HRDatastore", null, Context.NONE); + manager.datastores().delete("testrg", "HRDatastore", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresGetByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresGetByResourceGroupSamples.java index 6ff5622d9853..79871da228a4 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresGetByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Datastores GetByResourceGroup. */ public final class DatastoresGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetDatastore.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetDatastore.json */ /** * Sample code: GetDatastore. @@ -17,6 +15,6 @@ public final class DatastoresGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getDatastore(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.datastores().getByResourceGroupWithResponse("testrg", "HRDatastore", Context.NONE); + manager.datastores().getByResourceGroupWithResponse("testrg", "HRDatastore", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresListByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresListByResourceGroupSamples.java index fe843c5c3ef7..689cf743e0e7 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresListByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Datastores ListByResourceGroup. */ public final class DatastoresListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastoresByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListDatastoresByResourceGroup.json */ /** * Sample code: ListDatastoresByResourceGroup. @@ -18,6 +16,6 @@ public final class DatastoresListByResourceGroupSamples { */ public static void listDatastoresByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.datastores().listByResourceGroup("testrg", Context.NONE); + manager.datastores().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresListSamples.java index ba7190208535..ec0f15944641 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresListSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Datastores List. */ public final class DatastoresListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListDatastores.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListDatastores.json */ /** * Sample code: ListDatastores. @@ -17,6 +15,6 @@ public final class DatastoresListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listDatastores(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.datastores().list(Context.NONE); + manager.datastores().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresUpdateSamples.java index ca550b6ea1a1..483db9a0677d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresUpdateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/DatastoresUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.Datastore; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for Datastores Update. */ public final class DatastoresUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateDatastore.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateDatastore.json */ /** * Sample code: UpdateDatastore. @@ -21,10 +20,14 @@ public final class DatastoresUpdateSamples { */ public static void updateDatastore(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { Datastore resource = - manager.datastores().getByResourceGroupWithResponse("testrg", "HRDatastore", Context.NONE).getValue(); + manager + .datastores() + .getByResourceGroupWithResponse("testrg", "HRDatastore", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsCreateSamples.java deleted file mode 100644 index b485d4d1e31c..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsCreateSamples.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.resourcemanager.connectedvmware.models.GuestCredential; -import com.azure.resourcemanager.connectedvmware.models.HttpProxyConfiguration; -import com.azure.resourcemanager.connectedvmware.models.ProvisioningAction; - -/** Samples for GuestAgents Create. */ -public final class GuestAgentsCreateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateGuestAgent.json - */ - /** - * Sample code: CreateGuestAgent. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void createGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager - .guestAgents() - .define("default") - .withExistingVirtualMachine("testrg", "ContosoVm") - .withCredentials(new GuestCredential().withUsername("tempuser").withPassword("")) - .withHttpProxyConfig(new HttpProxyConfiguration().withHttpsProxy("http://192.1.2.3:8080")) - .withProvisioningAction(ProvisioningAction.INSTALL) - .create(); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsCreateSamples.java index 24e2bb3cba5e..39b406e3834c 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsCreateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsCreateSamples.java @@ -9,7 +9,7 @@ /** Samples for Hosts Create. */ public final class HostsCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHost.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateHost.json */ /** * Sample code: CreateHost. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsDeleteSamples.java index 084c644436be..638eac1f45ee 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Hosts Delete. */ public final class HostsDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHost.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteHost.json */ /** * Sample code: DeleteHost. @@ -17,6 +15,6 @@ public final class HostsDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteHost(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hosts().delete("testrg", "HRHost", null, Context.NONE); + manager.hosts().delete("testrg", "HRHost", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsGetByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsGetByResourceGroupSamples.java index 7c49e73d48a5..b10574143225 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsGetByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Hosts GetByResourceGroup. */ public final class HostsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHost.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetHost.json */ /** * Sample code: GetHost. @@ -17,6 +15,6 @@ public final class HostsGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getHost(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hosts().getByResourceGroupWithResponse("testrg", "HRHost", Context.NONE); + manager.hosts().getByResourceGroupWithResponse("testrg", "HRHost", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsListByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsListByResourceGroupSamples.java index fa9c59105e2c..79da5127cb3d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsListByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Hosts ListByResourceGroup. */ public final class HostsListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHostsByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListHostsByResourceGroup.json */ /** * Sample code: ListHostsByResourceGroup. @@ -18,6 +16,6 @@ public final class HostsListByResourceGroupSamples { */ public static void listHostsByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hosts().listByResourceGroup("testrg", Context.NONE); + manager.hosts().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsListSamples.java index 458b08366100..e3a8458342a7 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsListSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Hosts List. */ public final class HostsListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListHosts.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListHosts.json */ /** * Sample code: ListHosts. @@ -17,6 +15,6 @@ public final class HostsListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listHosts(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hosts().list(Context.NONE); + manager.hosts().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsUpdateSamples.java index 3d8941004f51..299365733ec5 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsUpdateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HostsUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.HostModel; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for Hosts Update. */ public final class HostsUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateHost.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateHost.json */ /** * Sample code: UpdateHost. @@ -21,10 +20,14 @@ public final class HostsUpdateSamples { */ public static void updateHost(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { HostModel resource = - manager.hosts().getByResourceGroupWithResponse("testrg", "HRHost", Context.NONE).getValue(); + manager + .hosts() + .getByResourceGroupWithResponse("testrg", "HRHost", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataCreateSamples.java deleted file mode 100644 index 1dac6287a2e9..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataCreateSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -/** Samples for HybridIdentityMetadata Create. */ -public final class HybridIdentityMetadataCreateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateHybridIdentityMetadata.json - */ - /** - * Sample code: CreateHybridIdentityMetadata. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void createHybridIdentityMetadata( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager - .hybridIdentityMetadatas() - .define("default") - .withExistingVirtualMachine("testrg", "ContosoVm") - .withVmId("f8b82dff-38ef-4220-99ef-d3a3f86ddc6c") - .withPublicKey("8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2") - .create(); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataDeleteSamples.java deleted file mode 100644 index 43a481958731..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataDeleteSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.core.util.Context; - -/** Samples for HybridIdentityMetadata Delete. */ -public final class HybridIdentityMetadataDeleteSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteHybridIdentityMetadata.json - */ - /** - * Sample code: DeleteHybridIdentityMetadata. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void deleteHybridIdentityMetadata( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hybridIdentityMetadatas().deleteWithResponse("testrg", "ContosoVm", "default", Context.NONE); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsCreateSamples.java index 125267f232e4..376eb43d24e5 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsCreateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsCreateSamples.java @@ -4,10 +4,12 @@ package com.azure.resourcemanager.connectedvmware.generated; +import com.azure.resourcemanager.connectedvmware.models.ResourcePoolInventoryItem; + /** Samples for InventoryItems Create. */ public final class InventoryItemsCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateInventoryItem.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateInventoryItem.json */ /** * Sample code: CreateInventoryItem. @@ -15,6 +17,11 @@ public final class InventoryItemsCreateSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void createInventoryItem(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.inventoryItems().define("testItem").withExistingVcenter("testrg", "ContosoVCenter").create(); + manager + .inventoryItems() + .define("testItem") + .withExistingVcenter("testrg", "ContosoVCenter") + .withProperties(new ResourcePoolInventoryItem()) + .create(); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsDeleteSamples.java index 103c342d0c0c..d08a6f0a1d72 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for InventoryItems Delete. */ public final class InventoryItemsDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteInventoryItem.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteInventoryItem.json */ /** * Sample code: DeleteInventoryItem. @@ -17,6 +15,8 @@ public final class InventoryItemsDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteInventoryItem(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.inventoryItems().deleteWithResponse("testrg", "ContosoVCenter", "testItem", Context.NONE); + manager + .inventoryItems() + .deleteWithResponse("testrg", "ContosoVCenter", "testItem", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsGetSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsGetSamples.java index 45e04dd4a77e..a51125212a36 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsGetSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for InventoryItems Get. */ public final class InventoryItemsGetSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetInventoryItem.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetInventoryItem.json */ /** * Sample code: GetInventoryItem. @@ -17,6 +15,8 @@ public final class InventoryItemsGetSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getInventoryItem(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.inventoryItems().getWithResponse("testrg", "ContosoVCenter", "testItem", Context.NONE); + manager + .inventoryItems() + .getWithResponse("testrg", "ContosoVCenter", "testItem", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsListByVCenterSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsListByVCenterSamples.java index 5187e7b25cc4..2e88e38d60c0 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsListByVCenterSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/InventoryItemsListByVCenterSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for InventoryItems ListByVCenter. */ public final class InventoryItemsListByVCenterSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/InventoryItems_ListByVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/InventoryItems_ListByVCenter.json */ /** * Sample code: InventoryItemsListByVCenter. @@ -18,6 +16,6 @@ public final class InventoryItemsListByVCenterSamples { */ public static void inventoryItemsListByVCenter( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.inventoryItems().listByVCenter("testrg", "ContosoVCenter", Context.NONE); + manager.inventoryItems().listByVCenter("testrg", "ContosoVCenter", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsCreateOrUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsCreateOrUpdateSamples.java deleted file mode 100644 index 3828132cb886..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsCreateOrUpdateSamples.java +++ /dev/null @@ -1,41 +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.connectedvmware.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - -/** Samples for MachineExtensions CreateOrUpdate. */ -public final class MachineExtensionsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/PUTExtension.json - */ - /** - * Sample code: Create or Update a Machine Extension (PUT). - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void createOrUpdateAMachineExtensionPUT( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) throws IOException { - manager - .machineExtensions() - .define("CustomScriptExtension") - .withRegion("eastus2euap") - .withExistingVirtualMachine("myResourceGroup", "myMachine") - .withPublisher("Microsoft.Compute") - .withTypePropertiesType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt 10000" - + " }\\\"\"}", - Object.class, - SerializerEncoding.JSON)) - .create(); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsDeleteSamples.java deleted file mode 100644 index 8ae3ff9dec50..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsDeleteSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.core.util.Context; - -/** Samples for MachineExtensions Delete. */ -public final class MachineExtensionsDeleteSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DELETEExtension.json - */ - /** - * Sample code: Delete a Machine Extension. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void deleteAMachineExtension( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.machineExtensions().delete("myResourceGroup", "myMachine", "MMA", Context.NONE); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsGetSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsGetSamples.java deleted file mode 100644 index 35f2c43d7c6d..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.core.util.Context; - -/** Samples for MachineExtensions Get. */ -public final class MachineExtensionsGetSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GETExtension.json - */ - /** - * Sample code: Get Machine Extension. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void getMachineExtension(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager - .machineExtensions() - .getWithResponse("myResourceGroup", "myMachine", "CustomScriptExtension", Context.NONE); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsListSamples.java deleted file mode 100644 index 3504bfe83e27..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.core.util.Context; - -/** Samples for MachineExtensions List. */ -public final class MachineExtensionsListSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/LISTExtension.json - */ - /** - * Sample code: Get all Machine Extensions. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void getAllMachineExtensions( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.machineExtensions().list("myResourceGroup", "myMachine", null, Context.NONE); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsUpdateSamples.java deleted file mode 100644 index 1dbc73426905..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/MachineExtensionsUpdateSamples.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.connectedvmware.models.MachineExtension; -import java.io.IOException; - -/** Samples for MachineExtensions Update. */ -public final class MachineExtensionsUpdateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateExtension.json - */ - /** - * Sample code: Create or Update a Machine Extension (PATCH). - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void createOrUpdateAMachineExtensionPATCH( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) throws IOException { - MachineExtension resource = - manager - .machineExtensions() - .getWithResponse("myResourceGroup", "myMachine", "CustomScriptExtension", Context.NONE) - .getValue(); - resource - .update() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt 100" - + " }\\\"\"}", - Object.class, - SerializerEncoding.JSON)) - .apply(); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/OperationsListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/OperationsListSamples.java index b1e40ab60676..a1c682f0a323 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/OperationsListSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/OperationsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListOperations.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListOperations.json */ /** * Sample code: ListOperations. @@ -17,6 +15,6 @@ public final class OperationsListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listOperations(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsCreateSamples.java index 7c050e982faa..a7997ab4cc0f 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsCreateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsCreateSamples.java @@ -9,7 +9,7 @@ /** Samples for ResourcePools Create. */ public final class ResourcePoolsCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateResourcePool.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateResourcePool.json */ /** * Sample code: CreateResourcePool. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsDeleteSamples.java index 1332cbf4dc33..3cdc6648a843 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for ResourcePools Delete. */ public final class ResourcePoolsDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteResourcePool.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteResourcePool.json */ /** * Sample code: DeleteResourcePool. @@ -17,6 +15,6 @@ public final class ResourcePoolsDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteResourcePool(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.resourcePools().delete("testrg", "HRPool", null, Context.NONE); + manager.resourcePools().delete("testrg", "HRPool", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsGetByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsGetByResourceGroupSamples.java index 89226eecb2d2..5be30d179617 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsGetByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for ResourcePools GetByResourceGroup. */ public final class ResourcePoolsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetResourcePool.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetResourcePool.json */ /** * Sample code: GetResourcePool. @@ -17,6 +15,6 @@ public final class ResourcePoolsGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getResourcePool(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.resourcePools().getByResourceGroupWithResponse("testrg", "HRPool", Context.NONE); + manager.resourcePools().getByResourceGroupWithResponse("testrg", "HRPool", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsListByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsListByResourceGroupSamples.java index a295cd61df48..488acc345e45 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsListByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for ResourcePools ListByResourceGroup. */ public final class ResourcePoolsListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePoolsByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListResourcePoolsByResourceGroup.json */ /** * Sample code: ListResourcePoolsByResourceGroup. @@ -18,6 +16,6 @@ public final class ResourcePoolsListByResourceGroupSamples { */ public static void listResourcePoolsByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.resourcePools().listByResourceGroup("testrg", Context.NONE); + manager.resourcePools().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsListSamples.java index 27f2306f53f9..8a68bf07e7db 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsListSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for ResourcePools List. */ public final class ResourcePoolsListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListResourcePools.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListResourcePools.json */ /** * Sample code: ListResourcePools. @@ -17,6 +15,6 @@ public final class ResourcePoolsListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listResourcePools(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.resourcePools().list(Context.NONE); + manager.resourcePools().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsUpdateSamples.java index ccc608c9a9be..9689139098a5 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsUpdateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/ResourcePoolsUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.ResourcePool; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for ResourcePools Update. */ public final class ResourcePoolsUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateResourcePool.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateResourcePool.json */ /** * Sample code: UpdateResourcePool. @@ -21,10 +20,14 @@ public final class ResourcePoolsUpdateSamples { */ public static void updateResourcePool(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { ResourcePool resource = - manager.resourcePools().getByResourceGroupWithResponse("testrg", "HRPool", Context.NONE).getValue(); + manager + .resourcePools() + .getByResourceGroupWithResponse("testrg", "HRPool", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersCreateSamples.java index 1f5b8a67e58d..463c9d7c1ece 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersCreateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersCreateSamples.java @@ -10,7 +10,7 @@ /** Samples for VCenters Create. */ public final class VCentersCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVCenter.json */ /** * Sample code: CreateVCenter. @@ -30,7 +30,7 @@ public static void createVCenter(com.azure.resourcemanager.connectedvmware.Conne .withName( "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso")) .withPort(1234) - .withCredentials(new VICredential().withUsername("tempuser").withPassword("")) + .withCredentials(new VICredential().withUsername("tempuser").withPassword("fakeTokenPlaceholder")) .create(); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersDeleteSamples.java index 0c6a8fb99b94..39fa2fd405cf 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VCenters Delete. */ public final class VCentersDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVCenter.json */ /** * Sample code: DeleteVCenter. @@ -17,6 +15,6 @@ public final class VCentersDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteVCenter(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.vCenters().delete("testrg", "ContosoVCenter", null, Context.NONE); + manager.vCenters().delete("testrg", "ContosoVCenter", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersGetByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersGetByResourceGroupSamples.java index 2e3fcd75b504..87933a1e6ad5 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersGetByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VCenters GetByResourceGroup. */ public final class VCentersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVCenter.json */ /** * Sample code: GetVCenter. @@ -17,6 +15,6 @@ public final class VCentersGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getVCenter(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.vCenters().getByResourceGroupWithResponse("testrg", "ContosoVCenter", Context.NONE); + manager.vCenters().getByResourceGroupWithResponse("testrg", "ContosoVCenter", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersListByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersListByResourceGroupSamples.java index 23b3ff886901..f17442b2d1f8 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersListByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VCenters ListByResourceGroup. */ public final class VCentersListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCentersByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVCentersByResourceGroup.json */ /** * Sample code: ListVCentersByResourceGroup. @@ -18,6 +16,6 @@ public final class VCentersListByResourceGroupSamples { */ public static void listVCentersByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.vCenters().listByResourceGroup("testrg", Context.NONE); + manager.vCenters().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersListSamples.java index 05caa2661a0d..f7c2341f21c8 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersListSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VCenters List. */ public final class VCentersListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVCenters.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVCenters.json */ /** * Sample code: ListVCenters. @@ -17,6 +15,6 @@ public final class VCentersListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listVCenters(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.vCenters().list(Context.NONE); + manager.vCenters().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersUpdateSamples.java index 04dd64ea23a6..4396903c91a8 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersUpdateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VCentersUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.VCenter; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for VCenters Update. */ public final class VCentersUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVCenter.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVCenter.json */ /** * Sample code: UpdateVCenter. @@ -21,10 +20,14 @@ public final class VCentersUpdateSamples { */ public static void updateVCenter(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { VCenter resource = - manager.vCenters().getByResourceGroupWithResponse("testrg", "ContosoVCenter", Context.NONE).getValue(); + manager + .vCenters() + .getByResourceGroupWithResponse("testrg", "ContosoVCenter", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsCreateSamples.java new file mode 100644 index 000000000000..fa9024734dde --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsCreateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.generated; + +import com.azure.resourcemanager.connectedvmware.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.connectedvmware.models.GuestCredential; +import com.azure.resourcemanager.connectedvmware.models.HttpProxyConfiguration; +import com.azure.resourcemanager.connectedvmware.models.ProvisioningAction; + +/** Samples for VMInstanceGuestAgents Create. */ +public final class VMInstanceGuestAgentsCreateSamples { + /* + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVMInstanceGuestAgent.json + */ + /** + * Sample code: CreateGuestAgent. + * + * @param manager Entry point to ConnectedVMwareManager. + */ + public static void createGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .vMInstanceGuestAgents() + .create( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + new GuestAgentInner() + .withCredentials( + new GuestCredential().withUsername("tempuser").withPassword("fakeTokenPlaceholder")) + .withPrivateLinkScopeResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName") + .withHttpProxyConfig(new HttpProxyConfiguration().withHttpsProxy("http://192.1.2.3:8080")) + .withProvisioningAction(ProvisioningAction.INSTALL), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsDeleteSamples.java similarity index 53% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsDeleteSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsDeleteSamples.java index 62fd5375e6ca..57af40ea08e3 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - -/** Samples for GuestAgents Delete. */ -public final class GuestAgentsDeleteSamples { +/** Samples for VMInstanceGuestAgents Delete. */ +public final class VMInstanceGuestAgentsDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteGuestAgent.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVMInstanceGuestAgent.json */ /** * Sample code: DeleteGuestAgent. @@ -17,6 +15,10 @@ public final class GuestAgentsDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.guestAgents().delete("testrg", "ContosoVm", "default", Context.NONE); + manager + .vMInstanceGuestAgents() + .delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsGetSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsGetSamples.java similarity index 53% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsGetSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsGetSamples.java index 1aef790efaea..3889fdecad97 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsGetSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - -/** Samples for GuestAgents Get. */ -public final class GuestAgentsGetSamples { +/** Samples for VMInstanceGuestAgents Get. */ +public final class VMInstanceGuestAgentsGetSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetGuestAgent.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVMInstanceGuestAgent.json */ /** * Sample code: GetGuestAgent. @@ -17,6 +15,10 @@ public final class GuestAgentsGetSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getGuestAgent(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.guestAgents().getWithResponse("testrg", "ContosoVm", "default", Context.NONE); + manager + .vMInstanceGuestAgents() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsListByVmSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsListSamples.java similarity index 53% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsListByVmSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsListSamples.java index d3156fd2f675..cb0782dfa890 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/GuestAgentsListByVmSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VMInstanceGuestAgentsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - -/** Samples for GuestAgents ListByVm. */ -public final class GuestAgentsListByVmSamples { +/** Samples for VMInstanceGuestAgents List. */ +public final class VMInstanceGuestAgentsListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GuestAgent_ListByVm.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/VMInstanceGuestAgent_ListByVm.json */ /** * Sample code: GuestAgentListByVm. @@ -17,6 +15,10 @@ public final class GuestAgentsListByVmSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void guestAgentListByVm(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.guestAgents().listByVm("testrg", "ContosoVm", Context.NONE); + manager + .vMInstanceGuestAgents() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesCreateOrUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f1de4c7164ce --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesCreateOrUpdateSamples.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.connectedvmware.generated; + +import com.azure.resourcemanager.connectedvmware.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; +import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; +import com.azure.resourcemanager.connectedvmware.models.InfrastructureProfile; +import com.azure.resourcemanager.connectedvmware.models.PlacementProfile; + +/** Samples for VirtualMachineInstances CreateOrUpdate. */ +public final class VirtualMachineInstancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVirtualMachineInstance.json + */ + /** + * Sample code: CreateVirtualMachine. + * + * @param manager Entry point to ConnectedVMwareManager. + */ + public static void createVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineInstances() + .createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceInner() + .withExtendedLocation( + new ExtendedLocation() + .withType("customLocation") + .withName( + "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso")) + .withPlacementProfile( + new PlacementProfile() + .withResourcePoolId( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool")) + .withHardwareProfile(new HardwareProfile().withMemorySizeMB(4196).withNumCPUs(4)) + .withInfrastructureProfile( + new InfrastructureProfile() + .withTemplateId( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate") + .withVCenterId( + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesDeleteSamples.java similarity index 51% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesDeleteSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesDeleteSamples.java index 2f2bab68f54b..a53585b1bda6 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Delete. */ -public final class VirtualMachinesDeleteSamples { +/** Samples for VirtualMachineInstances Delete. */ +public final class VirtualMachineInstancesDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVirtualMachineInstance.json */ /** * Sample code: DeleteVirtualMachine. @@ -17,6 +15,12 @@ public final class VirtualMachinesDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().delete("testrg", "DemoVM", null, null, Context.NONE); + manager + .virtualMachineInstances() + .delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + null, + null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesGetSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesGetSamples.java new file mode 100644 index 000000000000..93791e420831 --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesGetSamples.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.connectedvmware.generated; + +/** Samples for VirtualMachineInstances Get. */ +public final class VirtualMachineInstancesGetSamples { + /* + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVirtualMachineInstance.json + */ + /** + * Sample code: GetVirtualMachine. + * + * @param manager Entry point to ConnectedVMwareManager. + */ + public static void getVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineInstances() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesGetByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesListSamples.java similarity index 53% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesGetByResourceGroupSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesListSamples.java index f0b0222ce73e..964f9f9e8ccc 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesGetByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - -/** Samples for VirtualMachines GetByResourceGroup. */ -public final class VirtualMachinesGetByResourceGroupSamples { +/** Samples for VirtualMachineInstances List. */ +public final class VirtualMachineInstancesListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualMachineInstances.json */ /** * Sample code: GetVirtualMachine. @@ -17,6 +15,10 @@ public final class VirtualMachinesGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().getByResourceGroupWithResponse("testrg", "DemoVM", Context.NONE); + manager + .virtualMachineInstances() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesRestartSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesRestartSamples.java similarity index 53% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesRestartSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesRestartSamples.java index 92809098d04c..89511f9e2581 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesRestartSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesRestartSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Restart. */ -public final class VirtualMachinesRestartSamples { +/** Samples for VirtualMachineInstances Restart. */ +public final class VirtualMachineInstancesRestartSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/RestartVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/RestartVirtualMachineInstance.json */ /** * Sample code: RestartVirtualMachine. @@ -17,6 +15,10 @@ public final class VirtualMachinesRestartSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void restartVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().restart("testrg", "DemoVM", Context.NONE); + manager + .virtualMachineInstances() + .restart( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesStartSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesStartSamples.java similarity index 53% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesStartSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesStartSamples.java index a5f2d3929cd8..0cb50ff8819b 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesStartSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesStartSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Start. */ -public final class VirtualMachinesStartSamples { +/** Samples for VirtualMachineInstances Start. */ +public final class VirtualMachineInstancesStartSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StartVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/StartVirtualMachineInstance.json */ /** * Sample code: StartVirtualMachine. @@ -17,6 +15,10 @@ public final class VirtualMachinesStartSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void startVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().start("testrg", "DemoVM", Context.NONE); + manager + .virtualMachineInstances() + .start( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesStopSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesStopSamples.java similarity index 55% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesStopSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesStopSamples.java index cf7b2c5db186..51545eac85cb 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesStopSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesStopSamples.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.StopVirtualMachineOptions; -/** Samples for VirtualMachines Stop. */ -public final class VirtualMachinesStopSamples { +/** Samples for VirtualMachineInstances Stop. */ +public final class VirtualMachineInstancesStopSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/StopVirtualMachine.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/StopVirtualMachineInstance.json */ /** * Sample code: StopVirtualMachine. @@ -19,7 +18,10 @@ public final class VirtualMachinesStopSamples { */ public static void stopVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { manager - .virtualMachines() - .stop("testrg", "DemoVM", new StopVirtualMachineOptions().withSkipShutdown(true), Context.NONE); + .virtualMachineInstances() + .stop( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + new StopVirtualMachineOptions().withSkipShutdown(true), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesUpdateSamples.java new file mode 100644 index 000000000000..a605865c2d5c --- /dev/null +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineInstancesUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.connectedvmware.generated; + +import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; +import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstanceUpdate; + +/** Samples for VirtualMachineInstances Update. */ +public final class VirtualMachineInstancesUpdateSamples { + /* + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVirtualMachineInstance.json + */ + /** + * Sample code: UpdateVirtualMachine. + * + * @param manager Entry point to ConnectedVMwareManager. + */ + public static void updateVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { + manager + .virtualMachineInstances() + .update( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + new VirtualMachineInstanceUpdate() + .withHardwareProfile(new HardwareProfile().withMemorySizeMB(4196).withNumCPUs(4)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesCreateSamples.java index 7bb26a95d2d1..0e02330207d9 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesCreateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesCreateSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualMachineTemplates Create. */ public final class VirtualMachineTemplatesCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachineTemplate.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVirtualMachineTemplate.json */ /** * Sample code: CreateVirtualMachineTemplate. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesDeleteSamples.java index 5ab85e32179e..30c45dd016bb 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VirtualMachineTemplates Delete. */ public final class VirtualMachineTemplatesDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualMachineTemplate.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVirtualMachineTemplate.json */ /** * Sample code: DeleteVirtualMachineTemplate. @@ -18,6 +16,8 @@ public final class VirtualMachineTemplatesDeleteSamples { */ public static void deleteVirtualMachineTemplate( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachineTemplates().delete("testrg", "WebFrontEndTemplate", null, Context.NONE); + manager + .virtualMachineTemplates() + .delete("testrg", "WebFrontEndTemplate", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesGetByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesGetByResourceGroupSamples.java index 5105cd749508..e5be163efe6e 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesGetByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VirtualMachineTemplates GetByResourceGroup. */ public final class VirtualMachineTemplatesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualMachineTemplate.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVirtualMachineTemplate.json */ /** * Sample code: GetVirtualMachineTemplate. @@ -18,6 +16,8 @@ public final class VirtualMachineTemplatesGetByResourceGroupSamples { */ public static void getVirtualMachineTemplate( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachineTemplates().getByResourceGroupWithResponse("testrg", "WebFrontEndTemplate", Context.NONE); + manager + .virtualMachineTemplates() + .getByResourceGroupWithResponse("testrg", "WebFrontEndTemplate", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesListByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesListByResourceGroupSamples.java index 26280cbfdded..981f63bb8b25 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesListByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VirtualMachineTemplates ListByResourceGroup. */ public final class VirtualMachineTemplatesListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualMachineTemplatesByResourceGroup.json */ /** * Sample code: ListVirtualMachineTemplatesByResourceGroup. @@ -18,6 +16,6 @@ public final class VirtualMachineTemplatesListByResourceGroupSamples { */ public static void listVirtualMachineTemplatesByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachineTemplates().listByResourceGroup("testrg", Context.NONE); + manager.virtualMachineTemplates().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesListSamples.java index 3ea30c154da7..7cd5f2de4f49 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesListSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VirtualMachineTemplates List. */ public final class VirtualMachineTemplatesListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachineTemplates.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualMachineTemplates.json */ /** * Sample code: ListVirtualMachineTemplates. @@ -18,6 +16,6 @@ public final class VirtualMachineTemplatesListSamples { */ public static void listVirtualMachineTemplates( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachineTemplates().list(Context.NONE); + manager.virtualMachineTemplates().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesUpdateSamples.java index 9402ddc826aa..9b9f2aa28c79 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesUpdateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachineTemplatesUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.VirtualMachineTemplate; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for VirtualMachineTemplates Update. */ public final class VirtualMachineTemplatesUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachineTemplate.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVirtualMachineTemplate.json */ /** * Sample code: UpdateVirtualMachineTemplate. @@ -24,11 +23,12 @@ public static void updateVirtualMachineTemplate( VirtualMachineTemplate resource = manager .virtualMachineTemplates() - .getByResourceGroupWithResponse("testrg", "WebFrontEndTemplate", Context.NONE) + .getByResourceGroupWithResponse("testrg", "WebFrontEndTemplate", com.azure.core.util.Context.NONE) .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesAssessPatchesSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesAssessPatchesSamples.java deleted file mode 100644 index c744e68d6da7..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesAssessPatchesSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines AssessPatches. */ -public final class VirtualMachinesAssessPatchesSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineAssessPatches.json - */ - /** - * Sample code: Assess patch state of a machine. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void assessPatchStateOfAMachine( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().assessPatches("myResourceGroupName", "myMachineName", Context.NONE); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesCreateSamples.java deleted file mode 100644 index 0634c40abd67..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesCreateSamples.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.connectedvmware.generated; - -import com.azure.resourcemanager.connectedvmware.models.ExtendedLocation; -import com.azure.resourcemanager.connectedvmware.models.HardwareProfile; - -/** Samples for VirtualMachines Create. */ -public final class VirtualMachinesCreateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualMachine.json - */ - /** - * Sample code: CreateVirtualMachine. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void createVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager - .virtualMachines() - .define("DemoVM") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso")) - .withResourcePoolId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool") - .withTemplateId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate") - .withVCenterId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter") - .withHardwareProfile(new HardwareProfile().withMemorySizeMB(4196).withNumCPUs(4)) - .create(); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesInstallPatchesSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesInstallPatchesSamples.java deleted file mode 100644 index 07f8834c521c..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesInstallPatchesSamples.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.models.VMGuestPatchClassificationWindows; -import com.azure.resourcemanager.connectedvmware.models.VMGuestPatchRebootSetting; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachineInstallPatchesParameters; -import com.azure.resourcemanager.connectedvmware.models.WindowsParameters; -import java.time.OffsetDateTime; -import java.util.Arrays; - -/** Samples for VirtualMachines InstallPatches. */ -public final class VirtualMachinesInstallPatchesSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/VirtualMachineInstallPatches.json - */ - /** - * Sample code: Install patch state of a machine. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void installPatchStateOfAMachine( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager - .virtualMachines() - .installPatches( - "myResourceGroupName", - "myMachineName", - new VirtualMachineInstallPatchesParameters() - .withMaximumDuration("PT3H") - .withRebootSetting(VMGuestPatchRebootSetting.IF_REQUIRED) - .withWindowsParameters( - new WindowsParameters() - .withClassificationsToInclude( - Arrays - .asList( - VMGuestPatchClassificationWindows.CRITICAL, - VMGuestPatchClassificationWindows.SECURITY)) - .withMaxPatchPublishDate(OffsetDateTime.parse("2022-01-15T02:36:43.0539904+00:00"))), - Context.NONE); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesListByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesListByResourceGroupSamples.java deleted file mode 100644 index 05a76690e368..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesListByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines ListByResourceGroup. */ -public final class VirtualMachinesListByResourceGroupSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachinesByResourceGroup.json - */ - /** - * Sample code: ListVirtualMachinesByResourceGroup. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void listVirtualMachinesByResourceGroup( - com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().listByResourceGroup("testrg", Context.NONE); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesListSamples.java deleted file mode 100644 index e7a882e64719..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.connectedvmware.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines List. */ -public final class VirtualMachinesListSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualMachines.json - */ - /** - * Sample code: ListVirtualMachines. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void listVirtualMachines(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualMachines().list(Context.NONE); - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesUpdateSamples.java deleted file mode 100644 index c73a164de34c..000000000000 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualMachinesUpdateSamples.java +++ /dev/null @@ -1,38 +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.connectedvmware.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.connectedvmware.models.VirtualMachine; -import java.util.HashMap; -import java.util.Map; - -/** Samples for VirtualMachines Update. */ -public final class VirtualMachinesUpdateSamples { - /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualMachine.json - */ - /** - * Sample code: UpdateVirtualMachine. - * - * @param manager Entry point to ConnectedVMwareManager. - */ - public static void updateVirtualMachine(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - VirtualMachine resource = - manager.virtualMachines().getByResourceGroupWithResponse("testrg", "DemoVM", Context.NONE).getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksCreateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksCreateSamples.java index ff1ea60fc1b9..950da2c5a22d 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksCreateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksCreateSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualNetworks Create. */ public final class VirtualNetworksCreateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/CreateVirtualNetwork.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVirtualNetwork.json */ /** * Sample code: CreateVirtualNetwork. diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksDeleteSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksDeleteSamples.java index c2feb7ff49b1..011926be5494 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksDeleteSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VirtualNetworks Delete. */ public final class VirtualNetworksDeleteSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/DeleteVirtualNetwork.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVirtualNetwork.json */ /** * Sample code: DeleteVirtualNetwork. @@ -17,6 +15,6 @@ public final class VirtualNetworksDeleteSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void deleteVirtualNetwork(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualNetworks().delete("testrg", "ProdNetwork", null, Context.NONE); + manager.virtualNetworks().delete("testrg", "ProdNetwork", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksGetByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksGetByResourceGroupSamples.java index 1c24081a12a3..5a6cbbe28362 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksGetByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VirtualNetworks GetByResourceGroup. */ public final class VirtualNetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetVirtualNetwork.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVirtualNetwork.json */ /** * Sample code: GetVirtualNetwork. @@ -17,6 +15,8 @@ public final class VirtualNetworksGetByResourceGroupSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void getVirtualNetwork(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualNetworks().getByResourceGroupWithResponse("testrg", "ProdNetwork", Context.NONE); + manager + .virtualNetworks() + .getByResourceGroupWithResponse("testrg", "ProdNetwork", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksListByResourceGroupSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksListByResourceGroupSamples.java index 5213191ce3d8..6d4fda268399 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksListByResourceGroupSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VirtualNetworks ListByResourceGroup. */ public final class VirtualNetworksListByResourceGroupSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworksByResourceGroup.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualNetworksByResourceGroup.json */ /** * Sample code: ListVirtualNetworksByResourceGroup. @@ -18,6 +16,6 @@ public final class VirtualNetworksListByResourceGroupSamples { */ public static void listVirtualNetworksByResourceGroup( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualNetworks().listByResourceGroup("testrg", Context.NONE); + manager.virtualNetworks().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksListSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksListSamples.java index 4be5337dacb4..210cd52694bc 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksListSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - /** Samples for VirtualNetworks List. */ public final class VirtualNetworksListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/ListVirtualNetworks.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualNetworks.json */ /** * Sample code: ListVirtualNetworks. @@ -17,6 +15,6 @@ public final class VirtualNetworksListSamples { * @param manager Entry point to ConnectedVMwareManager. */ public static void listVirtualNetworks(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.virtualNetworks().list(Context.NONE); + manager.virtualNetworks().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksUpdateSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksUpdateSamples.java index 76e00c0d2c8a..165caa4f7dd4 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksUpdateSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VirtualNetworksUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.connectedvmware.models.VirtualNetwork; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for VirtualNetworks Update. */ public final class VirtualNetworksUpdateSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/UpdateVirtualNetwork.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVirtualNetwork.json */ /** * Sample code: UpdateVirtualNetwork. @@ -21,10 +20,14 @@ public final class VirtualNetworksUpdateSamples { */ public static void updateVirtualNetwork(com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { VirtualNetwork resource = - manager.virtualNetworks().getByResourceGroupWithResponse("testrg", "ProdNetwork", Context.NONE).getValue(); + manager + .virtualNetworks() + .getByResourceGroupWithResponse("testrg", "ProdNetwork", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataGetSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VmInstanceHybridIdentityMetadataGetSamples.java similarity index 52% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataGetSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VmInstanceHybridIdentityMetadataGetSamples.java index 807081194537..087055ec9cfc 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataGetSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VmInstanceHybridIdentityMetadataGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - -/** Samples for HybridIdentityMetadata Get. */ -public final class HybridIdentityMetadataGetSamples { +/** Samples for VmInstanceHybridIdentityMetadata Get. */ +public final class VmInstanceHybridIdentityMetadataGetSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/GetHybridIdentityMetadata.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVmInstanceHybridIdentityMetadata.json */ /** * Sample code: GetHybridIdentityMetadata. @@ -18,6 +16,10 @@ public final class HybridIdentityMetadataGetSamples { */ public static void getHybridIdentityMetadata( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hybridIdentityMetadatas().getWithResponse("testrg", "ContosoVm", "default", Context.NONE); + manager + .vmInstanceHybridIdentityMetadatas() + .getWithResponse( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataListByVmSamples.java b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VmInstanceHybridIdentityMetadataListSamples.java similarity index 53% rename from sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataListByVmSamples.java rename to sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VmInstanceHybridIdentityMetadataListSamples.java index dd7b70d5a3c1..ed6524cd27fe 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/HybridIdentityMetadataListByVmSamples.java +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/src/samples/java/com/azure/resourcemanager/connectedvmware/generated/VmInstanceHybridIdentityMetadataListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.connectedvmware.generated; -import com.azure.core.util.Context; - -/** Samples for HybridIdentityMetadata ListByVm. */ -public final class HybridIdentityMetadataListByVmSamples { +/** Samples for VmInstanceHybridIdentityMetadata List. */ +public final class VmInstanceHybridIdentityMetadataListSamples { /* - * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/preview/2022-01-10-preview/examples/HybridIdentityMetadata_ListByVm.json + * x-ms-original-file: specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/HybridIdentityMetadata_ListByVmInstance.json */ /** * Sample code: HybridIdentityMetadataListByVm. @@ -18,6 +16,10 @@ public final class HybridIdentityMetadataListByVmSamples { */ public static void hybridIdentityMetadataListByVm( com.azure.resourcemanager.connectedvmware.ConnectedVMwareManager manager) { - manager.hybridIdentityMetadatas().listByVm("testrg", "ContosoVm", Context.NONE); + manager + .vmInstanceHybridIdentityMetadatas() + .list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + com.azure.core.util.Context.NONE); } }